Verification.
Verify tk is installed first or STOP.
Workflow
- •Use
tk dep tree <id>to get all tickets associated with the specified task/epic. If the ticket is a super-epic (has links but empty dep tree), usetk show <id>to find its linked child epics and implement them in dependency order instead. - •Pick the first task that we can implement that is not blocked
- •Follow the Sub-task workflow below, ensure to launch these as sub-agents so they have isolated context. Do not launch parallel sub-agents if they will modify files, as they will conflict. Use seqential unless the task is nullipotent (e.g. explore, run tests, etc).
- •If the the task is successful move on to the next ticket, if not report back to user with suggestions on how to proceed. Suggestions cannot be "skip the work".
- •If we have exhausted all tickets STOP
Sub-task workflow
Used for implementing a single task.
- •Start a sub agent with the sub-agent rules below, do not start parallel agents unless nullipontent.
- •Use
tk show <id>to read a tickets contents - •Implement the ticket within the sub agent
- •If succesful
tk closethe ticket - •If shortcuts are taken create new tickets associated with the parent ticket documenting shortcuts, rationale and potential remediations.
- •If unsuccessful make sure the ticket remains open and report the user.
Sub-agent rules
You are to implement the ticket as specified, you must first gather context
if the context is useful add comments to the ticket with tk add-note {id} [text]
you must follow these rules.
- •NEVER "Simplify" tests, they are the source of truth for correctness.
- •When writing language tests (tests in test/unit) do not "fix them" if you believe the syntax to be correct, you are masking bugs.
- •NEVER Assume failures are a "pre-existing condition". If you need to prove
this to yourself, stash your changes and run
just ci - •NEVER decide that the work is "too complex", a "deep refactor" or "large change" and take shortcuts. If you cannot complete the task, provide suggetions on how to decompose it to the user.
- •NEVER use shortcuts in implementation, this is false progress.
- •NEVER keep something for "backwards compatability" unless explictly asked to.
- •ALWAYS use existing functions and helpers, do not create duplicates.
- •Use your tools,
ast-grep,just,rg,lldbetc; your default tools suck. - •If
just unit(vole test) is failing, NEVER grep output if running >1 times you often fail to locate the issue without seeing full output.
Limits
- •Functions should be no longer than ~80 lines, if they are, break them apart.
- •Functions should have no more than 5 arguments, if they need more, re-consider the design, or use a struct to pass in context.
- •Files should be no longer than ~1000 lines, if they are, break them apart.
Completing work
- •Add a unit test, to
test/unitif adding language features - •Add a sema test to
test/semaif adding sema features - •Before declaring success
just pre-commitmust pass. You do not need to runjust ciifjust pre-commitpasses - •NEVER ignore clippy warnings, this is a sign of bad code
- •If successful, do a brief code review of your changes, make sure the rules and limits and followed, and we didn't write crap to just get things working. It is okay to clean-up your code after the fact.
- •If cleaning up after code-review, verify again with with
just pre-commit - •If task and code-review successful, commit the work to
git.