Skip to content
Raw Markdown

Curate a git-managed project

Your context lives in a repository, so you change it there, usually by asking a coding agent such as Claude Code, Cursor or Codex, which runs the Cassis CLI for you. Take one issue to a tested pull request, then confirm the fix is live.

Work in the project’s checkout. Your agent needs the Cassis CLI and the Cassis MCP server; the repository needs a publisher, the GitHub App or a CI job.

For a new working folder, set up your coding agent once. Continue the steps below in the same agent conversation so it can use the evidence and decisions already discussed.

Each step shows what to ask your agent, what it does, and the commands behind it. Start from an issue you chose to fix in triage; with no issue behind the change, such as a new metric the business just agreed, start at step 2. For an app-managed project, follow the web app workflow.

1. Read the issue’s evidence

Show me what Cassis proposes for the active customer issue and the evidence behind it.
Claude Code · your repository
⏺ cassis - get_issue (MCP)
⏺ cassis - get_issue_evidence (MCP)
⏺

“Active customer” has no agreed definition: unreliable_answer, 1 occurrence.

Occurrence 1, a chat

  • Question: “How many active customers do we have?”
  • Symptom: Cassis stopped and asked what makes a customer active.
  • Diagnosis: nothing in the context defines an active customer.
  • Asker's reply: “at least one delivered order in the last 90 days”

Proposed fix: add a metric active_customers with that rule.

That rule comes from one asker, not from its owner. Confirm it before I write it?

Agent runs: get_issue (MCP); get_issue_evidence (MCP)

Agent: "Active customer" has no agreed definition: unreliable_answer, 1 occurrence. Occurrence 1, a chat. Question: "How many active customers do we have?" Symptom: Cassis stopped and asked what makes a customer active. Diagnosis: nothing in the context defines an active customer. Asker's reply: "at least one delivered order in the last 90 days". Proposed fix: add a metric active_customers with that rule. That rule comes from one asker, not from its owner. Confirm it before I write it?

Commands: over MCP, get_issue and get_issue_evidence; from the CLI, cassis issues show and cassis issues evidence.

An issue with several occurrences lists each one the same way; read them all before deciding.

2. Agree the rule, then write it

The asker’s reply is evidence, not a decision. Here the owner confirms the rule: customers with at least one delivered order placed in the last 90 days. For this historical dataset, measure the window from its latest order purchase timestamp.

The owner confirmed that proposed rule. Apply the fix on a new branch and show me the changes.

The agent creates the branch context/define-active-customers (branch names starting with cassis/ are reserved for Cassis) and writes one file:

name: active_customers
display_name: Active customers
description: Customers with at least one delivered order placed in the last 90
  days of this dataset. Use the latest order purchase timestamp as the reference
  date. Count people by CUSTOMER_UNIQUE_ID; CUSTOMER_ID changes with every order.
domain_path: marketplace/measuring-sales
expression: COUNT(DISTINCT "CUSTOMER_UNIQUE_ID")
filters: STALLORA.ORDERS.ORDER_STATUS = 'delivered'
  AND STALLORA.ORDERS.ORDER_PURCHASE_TIMESTAMP >= DATEADD(day, -90,
  (SELECT MAX(ORDER_PURCHASE_TIMESTAMP) FROM STALLORA.ORDERS))
  (requires JOIN CUSTOMERS.CUSTOMER_ID = ORDERS.CUSTOMER_ID)
synonyms:
- active customer count
- currently active customers
table_name: CUSTOMERS
table_schema: STALLORA
unit: customers

Commands: none from Cassis; the file follows the metrics format.

When the evidence shows missing data instead, as for the refund rate, no rule fixes it: the data has to reach the context first (source changes).

3. Test the change

Check the context, test it with "How many customers are currently active?", run the eval cases, and show me the SQL.
Example · Claude Code
⏺ Bash(cassis context check)
⏺ Bash(cassis context fmt)
⏺ Bash(cassis context check)
⏺ Bash(cassis context test -q "How many customers are currently active?")
⏺ Bash(cassis eval run)
⏺

All checks pass on context/define-active-customers.

context check: all files pass, schema references resolve. context test: answered without asking, 3,912 customers, through active_customers. eval run: 12/12 passed.

SELECT COUNT(DISTINCT c.CUSTOMER_UNIQUE_ID) AS active_customers
FROM STALLORA.CUSTOMERS c
JOIN STALLORA.ORDERS o ON o.CUSTOMER_ID = c.CUSTOMER_ID
WHERE o.ORDER_STATUS = 'delivered'
  AND o.ORDER_PURCHASE_TIMESTAMP >= DATEADD(
    day, -90,
    (SELECT MAX(ORDER_PURCHASE_TIMESTAMP) FROM STALLORA.ORDERS)
  )

Not committed yet.

Agent runs: cassis context check; cassis context fmt; cassis context check; cassis context test -q "How many customers are currently active?"; cassis eval run

Example agent: All checks pass on context/define-active-customers. context check: all files pass, schema references resolve. context test: answered without asking, 3,912 customers, through active_customers. eval run: 12/12 passed. Generated SQL: SELECT COUNT(DISTINCT c.CUSTOMER_UNIQUE_ID) AS active_customers FROM STALLORA.CUSTOMERS c JOIN STALLORA.ORDERS o ON o.CUSTOMER_ID = c.CUSTOMER_ID WHERE o.ORDER_STATUS = 'delivered' AND o.ORDER_PURCHASE_TIMESTAMP >= DATEADD(day, -90, (SELECT MAX(ORDER_PURCHASE_TIMESTAMP) FROM STALLORA.ORDERS)). Not committed yet.

Commands: cassis context check, cassis context fmt, cassis context test, cassis eval run.

A passing check means the files are valid, not that the rule is right. Read the SQL: it should count distinct CUSTOMER_UNIQUE_ID values for delivered orders placed in the 90 days ending at the dataset’s latest order purchase timestamp. The test question rewords the original, so a pass is not an echo, and the eval cases catch regressions. Nothing here publishes.

4. Open the pull request

The Resolves <issue-id> line in the description is what lets the GitHub App close the issue once the fix is published.

Open a pull request for this fix with the issue, evidence and test results.
Claude Code · your repository
⏺ Bash(git add cassis/metrics/active_customers.yml)
⏺ Bash(git commit -F -)
⏺ Bash(git push -u origin context/define-active-customers)
⏺ Bash(gh pr create --title "Define active customers" --body ...)
⏺

PR #23: github.com/your-org/analytics/pull/23

Commit 4c1e9a2 on context/define-active-customers, pushed. The description names the issue, the evidence and the test results, and carries Resolves 7f3a2c91-4b0e. CI (context check and eval run) is running on it now.

Agent runs: git add cassis/metrics/active_customers.yml; git commit -F -; git push -u origin context/define-active-customers; gh pr create --title "Define active customers" --body ...

Agent: PR #23: github.com/your-org/analytics/pull/23. Commit 4c1e9a2 on context/define-active-customers, pushed. The description names the issue, the evidence and the test results, and carries Resolves 7f3a2c91-4b0e. CI (context check and eval run) is running on it now.

Commands: Git, your host’s pull request tool, and cassis issues show for the Resolves line.

A teammate reviews and merges it; your repository’s permissions and required checks are the approval gate.

5. After merge

Publishing is automatic: the GitHub App imports the merged commit, or your default-branch CI job runs cassis context upload. With the App, the Resolves line then closes the issue on its own. With a CI publisher, the issue stays open until someone resolves it. Either way, confirm the new version is live:

The pull request is merged. Check that the fix is published and verify the active-customers answer in a new conversation. If it checks out, resolve the issue if it is still open.
Example · Claude Code
⏺ Bash(gh run watch)
⏺ Bash(cassis status)
⏺ cassis - ask_question (MCP)
⏺ cassis - update_issue_status (MCP)
⏺

Published and resolved.

  • main run: context validation ✓, publish to Cassis ✓
  • Published version v41 → v42, recording merge ab12cd3
  • New conversation: 3,912 active customers, answered without asking, using active_customers
  • Issue 7f3a2c91 is now resolved

Agent runs: gh run watch; cassis status; ask_question (MCP); update_issue_status (MCP)

Example agent: Published and resolved. main run: context validation passed, publish to Cassis passed. Published version v41 to v42, recording merge ab12cd3. New conversation: 3,912 active customers, answered without asking, using active_customers. Issue 7f3a2c91 is now resolved.

Commands: cassis status, ask_question over MCP, then update_issue_status over MCP or cassis issues resolve --published (editor or admin). cassis status --watch waits for the publish of the local HEAD, so run it from a checkout of the merged commit.

Once the owner validates the new answer’s SQL, save it as an eval case so a later change cannot break it. If the change makes answers worse, roll it back.

Hand over the whole task

To hand over the investigation, change and tests together, name the issue:

Prompt for an agent Take one detected issue to a pull request

Investigates and tests a fix, then opens a pull request for review.

Investigate the Cassis issue <issue title> and its proposed fix. Ask me about any business rule that still needs a decision. Prepare and test the fix on a branch, then open a pull request with the evidence and test results. Leave it for review.