Timecard Assistant
- SKILL.md
- timecard-assistant.gif
- timecard-assistant.png
Timecard Assistant
Helps a user get their weekly timecards done using the "Certinia" Salesforce connector. The connector's timecard tools are deferred, so load them first with tool_search (query: "timecard"). The four tools are:
| Tool | Purpose |
|---|---|
pse_SuggestTimecardsAction |
Returns the resource's scheduled assignments (and scheduled hours) for a week. Read-only; creates nothing. |
pse_SaveTimecardsAction |
Creates or updates a weekly timecard. |
pse_SubmitTimecardsAction |
Submits timecards for approval. |
pse_TimecardQueryAction |
Finds missing, incomplete, awaiting-approval, or variance timecards for a project. |
Hard rule: confirm before every write
Saving and submitting change the user's records. Never call Save or Submit until the user has explicitly confirmed that specific action in their latest message. Show exactly what you are about to do first, and ask for a go-ahead. Confirmation to save is not confirmation to submit; ask separately. Suggest and Query are read-only and need no confirmation.
Choosing the week
When the user asks to suggest (or create) a timecard and gives no dates, pick the week from today's date:
- Friday, Saturday or Sunday - the current week.
- Monday to Thursday - the previous week (the one just finished, which is usually the one still owed).
If the user states a week or date range ("last week", "week of Nov 3", "Nov 3 to Nov 14"), use that instead, always.
Mechanics:
- Pass any date inside the target week as
startDate. The action covers the whole week containing that date, with the week start day set by the resource's work calendar. Do not assume weeks start on Monday. - Trust the
weekStartDateandweekEndDatein the response as the real boundaries. - For a range spanning several weeks, make one Suggest call per week.
- Tell the user which week you chose and why in one line (e.g. "It's Wednesday, so I'm looking at last week, Nov 8 to Nov 14."), so they can redirect you.
- Leave
resourceIdblank to use the resource linked to the current user, unless the user names someone else.
Workflow
1. Suggest
Call pse_SuggestTimecardsAction with withScheduledHours: true. The hours on any timecard come from this action's output. Do not invent, estimate or pad hours. Present the suggestions clearly: project, assignment, and scheduled hours, plus the week dates.
Assignments that already have a timecard for the week are excluded automatically. Use excludedAssignmentIds only if the user asks to leave specific assignments out.
If suggestions come back empty, say so plainly. Likely reasons are that there are no scheduled assignments that week or the timecards already exist. Offer to check existing timecards with Query. Do not fabricate a timecard.
2. Save (after confirmation)
Ask whether to save the suggested timecards, showing a short summary: week, one row per timecard with project, assignment, and hours by day.
Once confirmed, call pse_SaveTimecardsAction with one entry per assignment:
projectIdandassignmentIdfrom the suggestion;startDateas any date in the target week.- Daily hours (
mondayHours...sundayHours) taken from the suggestion's scheduled hours. - If the suggestion gives only a weekly total rather than per-day hours, propose an even split across the working days, show it, and get confirmation before saving.
- To change an existing timecard, pass its
timecardId(the week cannot be changed). Omitted fields keep their values; set hours to 0 to clear a day. - Add notes only if the user provides them.
Report each result: saved or failed, the timecard ID, and any per-day errors in plain language. Keep the returned timecard IDs; they are needed for Submit.
3. Submit (after separate confirmation)
Offer to submit once saved, listing which timecards will go for approval. After confirmation, call pse_SubmitTimecardsAction with the timecard IDs. Each timecard is validated independently, so report success or the error message for each one. If IDs aren't known from this conversation, find them with Query first.
4. Query (status checks)
For questions like "what's missing?", "what's still unsubmitted?" or "what's awaiting approval?", call pse_TimecardQueryAction with the project (projectName supports partial matching, or projectId), the date range, and the relevant flags: includeMissing, includeIncomplete, includeAwaitingApproval, includeSubmittedWithVariance. If the project name matches several projects, ask the user to pick. If the user gives no project, ask which one.
Style
Keep replies short and scannable: state the week, show the table of what was found or will be done, and end with the single next step you're asking about. Don't narrate tool mechanics. If a call fails, give the error in plain words and suggest the likely fix rather than retrying blindly.