Commit f6fe8355 authored by whlwhlwhl's avatar whlwhlwhl
Browse files

Initial LightOp KernelPilot skill pack

parents
Pipeline #3628 canceled with stages
# Round Contract Missing
Before you try to exit this round, write the current round contract to:
`{{ROUND_CONTRACT_FILE}}`
The round contract must restate:
- The single **mainline objective** for this round
- The target ACs
- Which issues are truly **blocking**
- Which issues are **queued** and out of scope
- The concrete success criteria for this round
Do not continue without a round contract. The loop uses it to prevent goal drift.
# State Schema Outdated
State file is missing required field: `{{FIELD_NAME}}`
This indicates the session was started with an older version of humanize.
**Options:**
1. Cancel the session: `/humanize:cancel-rlcr-loop`
2. Update humanize plugin to version 1.1.2+
3. Restart with the updated plugin
The session will be terminated as 'unexpected' to preserve state information.
# State File Modification Blocked
You cannot modify `state.md`. This file is managed by the loop system. Modifying it would corrupt the loop state. If you think the work is done, just stop and another round of review will be auto-triggered.
# Direct Execution of Hook Scripts Blocked
You are attempting to directly execute a hook script via Bash. This is not allowed during an active loop.
Hook scripts are managed by the hooks system and are triggered automatically at the appropriate time. You should NOT execute them manually.
Simply complete your work and end your response. The hooks system will handle the rest automatically.
# Bash Write Blocked: Use Write or Edit Tool
Do not use Bash commands to modify summary files.
**Use the Write or Edit tool instead**: `{{CORRECT_PATH}}`
Bash commands like cat, echo, sed, awk, etc. bypass the validation hooks.
Please use the proper tools to ensure correct round number validation.
# Todos File Access Blocked
Do NOT create or access `round-*-todos.md` files.
**Use the native Task tools instead (TaskCreate, TaskUpdate, TaskList).**
The native task tools provide proper state tracking visible in the UI and
integration with Claude Code's task management system.
# Unpushed Commits Detected
You are trying to stop, but you have **{{AHEAD_COUNT}} unpushed commit(s)** on branch `{{CURRENT_BRANCH}}`.
Since `--push-every-round` is enabled, you must push your commits before exiting.
**Required Action**:
```bash
git push origin {{CURRENT_BRANCH}}
```
After pushing all commits, you may attempt to exit again.
# Work Summary Missing
You attempted to exit without writing your work summary.
**Required Action**: Write your work summary to:
```
{{SUMMARY_FILE}}
```
The summary should include:
- What was implemented
- Files created/modified
- Tests added/passed
- Any remaining items
After writing the summary, you may attempt to exit again.
# Wrong Round Contract Location
Round contract files MUST be in the active loop directory.
**Correct path**: `{{CORRECT_PATH}}`
# Wrong Directory Path
You are trying to {{ACTION}}: `{{FILE_PATH}}`
Correct path: `{{CORRECT_PATH}}`
If you need this file, use: `cat {{FILE_PATH}}`
# Wrong File Location
You are trying to read `{{FILE_PATH}}`, but loop files are in `{{ACTIVE_LOOP_DIR}}/`.
**Current round files**:
- Prompt: `{{ACTIVE_LOOP_DIR}}/round-{{CURRENT_ROUND}}-prompt.md`
- Summary: `{{ACTIVE_LOOP_DIR}}/round-{{CURRENT_ROUND}}-summary.md`
If you need this file, use: `cat {{FILE_PATH}}`
# Wrong Round File
You are trying to read `round-{{CLAUDE_ROUND}}-{{FILE_TYPE}}.md`, but the current round is **{{CURRENT_ROUND}}**.
**Current round files**:
- Prompt: `{{ACTIVE_LOOP_DIR}}/round-{{CURRENT_ROUND}}-prompt.md`
- Summary: `{{ACTIVE_LOOP_DIR}}/round-{{CURRENT_ROUND}}-summary.md`
If you need this file, use: `cat {{FILE_PATH}}`
# Wrong Round Number
You are trying to {{ACTION}} `round-{{CLAUDE_ROUND}}-{{FILE_TYPE}}.md`, but the current round is **{{CURRENT_ROUND}}**.
**Correct path**: `{{CORRECT_PATH}}`
Do NOT increment the round number yourself.
# Wrong Summary Location
Summary files MUST be in the loop directory.
**Correct path**: `{{CORRECT_PATH}}`
## Agent Teams Continuation
Continue using **Agent Teams mode** as the **Team Leader** within the RLCR development cycle. You are continuing from a previous round where Codex reviewed your work and provided feedback above.
### Continuation Context
- **Previous Team No Longer Exists**: Your teammates from the previous round are gone. Do NOT attempt to message or reference old teammates. You must create a brand new team for this round.
- **Review First**: Before spawning any team members, carefully analyze the Codex review feedback above. Understand which issues are most critical and plan your team allocation accordingly.
- **Do Not Redo Work**: Review what was accomplished in previous rounds (check the goal tracker and prior summaries). Only address the issues and gaps identified in the review - do not redo work that was already completed correctly.
- **Cold Start for New Members**: Each new team member has NO context from previous rounds and NO access to your conversation history. They DO have access to CLAUDE.md and project configuration automatically. When spawning members, provide: what was already accomplished in previous rounds, the current state of relevant files, specific review findings they need to address, and clear acceptance criteria. Do not repeat what CLAUDE.md already covers.
- **Multi-Iteration Awareness**: If the remaining work exceeds what a single team can accomplish in this round, prioritize the most critical items from the review. Address high-priority issues first so subsequent rounds have less to fix.
- **State Awareness**: Previous rounds may have left partial changes or introduced new patterns. Verify the current state of files (e.g., with quick reads or greps) before assigning file ownership to team members.
### Your Role
You are the team leader. Your ONLY job is coordination and delegation. You must NEVER write code, edit files, or implement anything yourself.
Your primary responsibilities are:
- **Split tasks** into independent, parallelizable units of work
- **Create agent teams** to execute these tasks using the Task tool with `team_name` parameter
- **Coordinate** team members to prevent overlapping or conflicting changes
- **Monitor progress** and resolve blocking issues between team members
- **Wait for teammates** to finish their work before proceeding - do not implement tasks yourself while waiting
If you feel the urge to implement something directly, STOP and delegate it to a team member instead.
### Guidelines
1. **Task Splitting**: Break work into independent tasks that can be worked on in parallel without file conflicts. Each task should have clear scope and acceptance criteria. Aim for 5-6 tasks per teammate to keep everyone productive and allow reassignment if someone gets stuck.
2. **Cold Start**: Every team member starts with zero prior context (they do NOT inherit your conversation history). However, they DO automatically load project-level CLAUDE.md files and MCP servers. When spawning members, focus on providing: the implementation plan or relevant goals, specific file paths they need to work on, what has been done so far, and what exactly needs to be accomplished. Do not repeat what CLAUDE.md already covers.
3. **File Conflict Prevention**: Two teammates editing the same file causes silent overwrites, not merge conflicts - one teammate's work will be completely lost. Assign strict file ownership boundaries. If two tasks must touch the same file, sequence them with task dependencies (blockedBy) so they never run in parallel.
4. **Coordination**: Track team member progress via TaskList and resolve any discovered dependencies. If a member is blocked or stuck, help unblock them or reassign the work to another member.
5. **Quality**: Review team member output before considering tasks complete. Verify that changes are correct, do not conflict with other members' work, and meet the acceptance criteria.
6. **Commits**: Each team member should commit their own changes. You coordinate the overall commit strategy and ensure all commits are properly sequenced.
7. **Plan Approval**: For high-risk or architecturally significant tasks, consider requiring teammates to plan before implementing (using plan mode). Review and approve their plans before they proceed.
8. **BitLesson Discipline**: Require running `bitlesson-selector` before each sub-task and record selected lesson IDs (or `NONE`) in the work notes.
### Important
- Use the Task tool to spawn agents as team members
- Monitor team members and reassign work if they get stuck
- Merge team work and resolve any conflicts before writing your summary
- Do NOT write code yourself - if you catch yourself about to edit a file or run implementation commands, delegate it instead
- When teammates go idle after sending you a message, this is NORMAL - they are waiting for your response, not done forever
## Agent Teams Mode
You are operating in **Agent Teams mode** as the **Team Leader** within an RLCR (Review-Loop-Correct-Repeat) development cycle.
This is the initial round. Read the implementation plan thoroughly before creating your team. Key RLCR files to be aware of:
- **Plan file** (provided above): The full scope of work and requirements your team must implement
- **Goal tracker** (`goal-tracker.md`): Tracks acceptance criteria, task status, and plan evolution - read it before splitting tasks
- **Work summary**: After all teammates finish, you must write a summary of what was accomplished into the designated summary file
Your work is not finished. Read and execute the below with ultrathink.
## Drift Recovery Mode
Codex judged the recent implementation rounds as failing to advance the mainline.
- Consecutive stalled/regressed rounds: {{STALL_COUNT}}
- Last mainline verdict: {{LAST_MAINLINE_VERDICT}}
This round is a **drift recovery round**. Do not continue with normal issue-clearing behavior.
## Original Implementation Plan
**IMPORTANT**: Re-anchor on the original plan first:
@{{PLAN_FILE}}
## Required Recovery Re-anchor
Before changing code:
- Re-read @{{PLAN_FILE}}
- Re-read @{{GOAL_TRACKER_FILE}}
- Re-read the recent round summaries and review results that led here
- Rewrite the round contract at @{{ROUND_CONTRACT_FILE}}
Your recovery contract must contain:
- Exactly one recovered **mainline objective**
- The 1-2 target ACs that prove mainline progress this round
- The root cause of recent drift or stagnation
- Which issues are truly **blocking** the recovered mainline objective
- Which issues remain **queued** and explicitly out of scope
- Concrete success criteria that would change the verdict back to `ADVANCED`
Do not start implementation until the recovery contract exists.
## Task Lane Rules
Use the Task system (TaskCreate, TaskUpdate, TaskList) with one required tag per task:
- `[mainline]` for plan-derived work that directly advances the recovered objective
- `[blocking]` for issues that prevent the recovered mainline objective from succeeding safely
- `[queued]` for non-blocking bugs, cleanup, or follow-up work
Rules:
- This round must prove mainline movement, not just reduce noise
- `[blocking]` work is allowed only when it directly unblocks the recovered mainline objective
- `[queued]` work must stay documented but must NOT replace the recovered objective
- If a new issue does not block the recovered objective, tag it `[queued]` and keep moving on mainline work
---
Below is Codex's review result:
<!-- CODEX's REVIEW RESULT START -->
{{REVIEW_CONTENT}}
<!-- CODEX's REVIEW RESULT END -->
---
## Goal Tracker Reference
Before starting work, **read and update** @{{GOAL_TRACKER_FILE}} as needed:
- Keep the immutable section unchanged
- Record the drift/stagnation cause in the mutable section if it changed planning
- Keep blocking vs queued issue classification accurate
- Ensure the tracker and contract now describe the same recovered mainline objective
## Recovery Guardrails
- Do not spend this round mostly on queued cleanup
- Do not broaden scope to compensate for previous stalls
- If the original approach was flawed, log the plan evolution explicitly instead of silently changing direction
- If you cannot produce a credible recovered mainline objective, say so in the summary with concrete blockers
# Finalize Phase
Codex review has passed. The implementation is complete and all acceptance criteria have been met.
You are now in the **Finalize Phase**. This is your opportunity to simplify and refactor the code before final completion.
## Your Task
Use the `code-simplifier:code-simplifier` agent via the Task tool to review and simplify the recent code changes.
Example invocation:
```
Task tool with subagent_type="code-simplifier:code-simplifier"
```
## Constraints
These constraints are **non-negotiable**:
1. **Must NOT change existing functionality** - All features must work exactly as before
2. **Must NOT fail existing tests** - Run tests to verify nothing is broken
3. **Must NOT introduce new bugs** - Be careful with refactoring
4. **Only perform functionality-equivalent changes** - Simplification and cleanup only
## Focus Areas
The code-simplifier agent should focus on:
- Code that was recently added or modified
- Focus more on changes between branch from `{{BASE_BRANCH}}` to `{{START_BRANCH}}`
- Removing unnecessary complexity
- Improving readability and maintainability
- Consolidating duplicate code
- Simplifying control flow where possible
- Removing dead code or unused variables
## Reference Files
- Original plan: @{{PLAN_FILE}}
- Goal tracker: @{{GOAL_TRACKER_FILE}}
## Before Exiting
1. Complete all `[mainline]` and `[blocking]` tasks (mark them as completed using TaskUpdate with status "completed")
2. `[queued]` tasks may remain only if they are documented as non-blocking follow-up work
3. Commit your changes with a descriptive message
4. Write your finalize summary to: **{{FINALIZE_SUMMARY_FILE}}**
Your summary should include:
- What simplifications were made
- Files modified during the Finalize Phase
- Confirmation that tests still pass
- Any notes about the refactoring decisions
# Finalize Phase (Review Skipped)
**Warning**: Code review was skipped due to: {{REVIEW_SKIP_REASON}}
The implementation could not be fully validated. You are now in the **Finalize Phase**.
## Important Notice
Since the code review was skipped, please manually verify your changes before finalizing:
1. Review your code changes for any obvious issues
2. Run any available tests to verify correctness
3. Check for common code quality issues
## Simplification (Optional)
If time permits, use the `code-simplifier:code-simplifier` agent via the Task tool to simplify and refactor your code.
Focus more on changes between branch from `{{BASE_BRANCH}}` to `{{START_BRANCH}}`.
Example invocation:
```
Task tool with subagent_type="code-simplifier:code-simplifier"
```
## Constraints
These constraints are **non-negotiable**:
1. **Must NOT change existing functionality** - All features must work exactly as before
2. **Must NOT fail existing tests** - Run tests to verify nothing is broken
3. **Must NOT introduce new bugs** - Be careful with refactoring
4. **Only perform functionality-equivalent changes** - Simplification and cleanup only
## Reference Files
- Original plan: @{{PLAN_FILE}}
- Goal tracker: @{{GOAL_TRACKER_FILE}}
## Before Exiting
1. Complete all `[mainline]` and `[blocking]` tasks (mark them as completed using TaskUpdate with status "completed")
2. `[queued]` tasks may remain only if they are documented as non-blocking follow-up work
3. Commit your changes with a descriptive message
4. Write your finalize summary to: **{{FINALIZE_SUMMARY_FILE}}**
Your summary should include:
- What work was done
- Files modified
- Confirmation that tests still pass (if possible)
- Any notes about manual verification performed
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment