Summary
| Task |
Description |
Typecheck |
Key finding |
| 1 |
Env variable auditor (p.bash, s.enum, s.optional) |
pass |
Typecheck passed; runtime fails on missing Copilot server (expected in CI) |
| 2 |
Git contributor stats (multiple p.bash, s.array of s.object) |
pass |
Clean — multiple p.bash in a single p\`` template works correctly |
| 3 |
File complexity classifier (p.bash, s.record(s.number), s.enum) |
pass |
s.record(s.number) as complexityDistribution required manual typing; no ergonomic shorthand |
| 4 |
Package health checker (two-agent chaining, p.read, s.boolean, s.enum) |
fail |
TS6133: 'extractor' is declared but its value is never read — noUnusedLocals: true rejects intermediate helper agents |
| 5 |
TODO tracker (p.bash, p.write, s.enum ×2, s.array of s.object) |
pass |
p.write inside p\`template accepted without complaint;s.enum` x2 in same schema works fine |
Problems encountered
Task 4 — noUnusedLocals rejects intermediate chaining agents
What the code tried to do: Declare two agents (extractor and assessor) where the intent is to call extractor first, pass its result to assessor. The extractor was declared as a module-level const without being explicitly called (since SKILL.md recommends exporting only the root agent and not calling agents at module scope).
What went wrong:
TS6133: 'extractor' is declared but its value is never read.
Because the project's tsconfig.json has "noUnusedLocals": true, an intermediate agent declaration that is only meant for conceptual chaining (without a direct call or explicit export) is rejected. This creates a trap: SKILL.md says "do not call agents directly at module scope" and "export exactly one default root agent", but noUnusedLocals requires all declared variables to be used or exported.
Minimal reproduction:
import { agent, s } from "rig";
const helper = agent({ model: "mini", instructions: "...", output: s.string }); // TS6133!
const root = agent({ model: "mini", instructions: "...", output: s.string });
export default root;
Fix applied: Collapsed both agents into one that does all work in a single pass. The two-agent chaining pattern requires either: (a) calling helper(...) inline in root's instruction template, or (b) registering helper under the agents spec field.
--typecheck does not exit-early — connects to Copilot after typecheck
When using cat program.ts | node rig.ts --typecheck, the runtime does NOT exit after a successful typecheck. It proceeds to connect to the Copilot SDK server. In CI environments without a running Copilot server this produces a confusing error: Failed to connect to CLI server: connect ECONNREFUSED 127.0.0.1:7777, even though the typecheck itself passed. A user cannot distinguish "typecheck passed" from "typecheck failed" based on exit code alone in this environment.
Expected behavior: --typecheck should exit 0 after a successful typecheck without attempting to connect to the agent runtime.
Improvement opportunities
Missing schema helpers (s.*)
s.literal(value) is documented in the header comments (s.literal(value,desc?) EnumSchema with a single value) but not prominently in SKILL.md. Generated code reached for s.enum("only-value") instead. Document s.literal with an example.
s.integer is listed in rig.ts comments but absent from SKILL.md. Integer-count fields like commitCount and lineNumber were typed as s.number, losing precision intent.
s.nullable is mentioned in the rig.ts header (s.nullable(inner) accepts inner|null) but not in SKILL.md's schema helpers section. Code used s.optional where s.nullable would be semantically more accurate.
Missing prompt helpers (p.*)
- No
p.glob(pattern) helper — when programs need to enumerate files to feed context, they use p.bash("find ... | head -N") as a workaround. A p.glob(pattern) intent that lists matching file paths would be cleaner and more composable.
- No
p.readMany(paths[]) helper — reading multiple files requires either multiple ${p.read(...)} expressions or a p.bash("cat file1 file2") workaround.
Error message quality
- When
--typecheck flag is used in stdin mode but typecheck passes, the subsequent ECONNREFUSED error gives no indication that typecheck succeeded. The error message should be preceded by a ✓ Typecheck passed line before attempting runtime connection.
- Typecheck errors reference a temp file path (
.tmp/rig-stdin-PIv7is/program.ts) rather than indicating it's the user's stdin program. The path should be normalized to <stdin program> in error output.
API ergonomics
- Two-agent chaining with
noUnusedLocals: The natural pattern of declaring a helper agent then an orchestrator fails under strict TypeScript settings. SKILL.md should document the required alternatives: (a) use agents spec field, (b) declare helper as export const, or (c) call the helper inline. Currently, SKILL.md's "do not call agents at module scope" guidance and noUnusedLocals: true are in direct conflict for multi-agent programs.
--typecheck-only flag: Users running in CI want to validate a program without a Copilot runtime. The current --typecheck flag still attempts to run after typecheck. A --typecheck-only (or --check) flag that exits after typecheck would fill this gap.
Documentation gaps
- SKILL.md lists
s.literal, s.integer, s.nullable in the rig.ts file header but not in the SKILL.md schema helpers table. These should be added.
- SKILL.md does not document the interaction between
noUnusedLocals and multi-agent programs — this is the most common authoring mistake for newcomers.
- SKILL.md says "For inline markdown skill mode, export exactly one default root agent with no input and do not call it directly" but does not clarify what to do with helper agents in multi-step chains.
Tasks run today
- (new) Task 1: Environment variable auditor classifying env vars as secret/path/other using
p.bash and s.enum
- (new) Task 2: Git contributor stats analyzer using multiple
p.bash calls and s.array of nested s.object
- (new) Task 3: TypeScript source file complexity classifier using
p.bash, s.record(s.number), and s.enum
- (new) Task 4: Package health checker with two-agent chaining using
p.read, s.boolean, s.enum — FAILED (noUnusedLocals rejects intermediate agent)
- (new) Task 5: TODO/FIXME/HACK comment tracker using
p.bash grep + p.write for markdown output, dual s.enum fields
Generated by Daily Rig Task Generator · sonnet46 82.3 AIC · ⌖ 4.77 AIC · ⊞ 5.5K · ◷
Summary
p.bash,s.enum,s.optional)multiple p.bash,s.arrayofs.object)p.bashin a singlep\`` template works correctlyp.bash,s.record(s.number),s.enum)s.record(s.number)ascomplexityDistributionrequired manual typing; no ergonomic shorthandp.read,s.boolean,s.enum)TS6133: 'extractor' is declared but its value is never read—noUnusedLocals: truerejects intermediate helper agentsp.bash,p.write,s.enum×2,s.arrayofs.object)p.writeinsidep\`template accepted without complaint;s.enum` x2 in same schema works fineProblems encountered
Task 4 —
noUnusedLocalsrejects intermediate chaining agentsWhat the code tried to do: Declare two agents (
extractorandassessor) where the intent is to callextractorfirst, pass its result toassessor. Theextractorwas declared as a module-levelconstwithout being explicitly called (since SKILL.md recommends exporting only the root agent and not calling agents at module scope).What went wrong:
Because the project's
tsconfig.jsonhas"noUnusedLocals": true, an intermediate agent declaration that is only meant for conceptual chaining (without a direct call or explicit export) is rejected. This creates a trap: SKILL.md says "do not call agents directly at module scope" and "export exactly one default root agent", butnoUnusedLocalsrequires all declared variables to be used or exported.Minimal reproduction:
Fix applied: Collapsed both agents into one that does all work in a single pass. The two-agent chaining pattern requires either: (a) calling
helper(...)inline inroot's instruction template, or (b) registeringhelperunder theagentsspec field.--typecheckdoes not exit-early — connects to Copilot after typecheckWhen using
cat program.ts | node rig.ts --typecheck, the runtime does NOT exit after a successful typecheck. It proceeds to connect to the Copilot SDK server. In CI environments without a running Copilot server this produces a confusing error:Failed to connect to CLI server: connect ECONNREFUSED 127.0.0.1:7777, even though the typecheck itself passed. A user cannot distinguish "typecheck passed" from "typecheck failed" based on exit code alone in this environment.Expected behavior:
--typecheckshould exit 0 after a successful typecheck without attempting to connect to the agent runtime.Improvement opportunities
Missing schema helpers (
s.*)s.literal(value)is documented in the header comments (s.literal(value,desc?) EnumSchema with a single value) but not prominently in SKILL.md. Generated code reached fors.enum("only-value")instead. Documents.literalwith an example.s.integeris listed in rig.ts comments but absent fromSKILL.md. Integer-count fields likecommitCountandlineNumberwere typed ass.number, losing precision intent.s.nullableis mentioned in the rig.ts header (s.nullable(inner) accepts inner|null) but not in SKILL.md's schema helpers section. Code useds.optionalwheres.nullablewould be semantically more accurate.Missing prompt helpers (
p.*)p.glob(pattern)helper — when programs need to enumerate files to feed context, they usep.bash("find ... | head -N")as a workaround. Ap.glob(pattern)intent that lists matching file paths would be cleaner and more composable.p.readMany(paths[])helper — reading multiple files requires either multiple${p.read(...)}expressions or ap.bash("cat file1 file2")workaround.Error message quality
--typecheckflag is used in stdin mode but typecheck passes, the subsequentECONNREFUSEDerror gives no indication that typecheck succeeded. The error message should be preceded by a✓ Typecheck passedline before attempting runtime connection..tmp/rig-stdin-PIv7is/program.ts) rather than indicating it's the user's stdin program. The path should be normalized to<stdin program>in error output.API ergonomics
noUnusedLocals: The natural pattern of declaring a helper agent then an orchestrator fails under strict TypeScript settings. SKILL.md should document the required alternatives: (a) useagentsspec field, (b) declare helper asexport const, or (c) call the helper inline. Currently, SKILL.md's "do not call agents at module scope" guidance andnoUnusedLocals: trueare in direct conflict for multi-agent programs.--typecheck-onlyflag: Users running in CI want to validate a program without a Copilot runtime. The current--typecheckflag still attempts to run after typecheck. A--typecheck-only(or--check) flag that exits after typecheck would fill this gap.Documentation gaps
s.literal,s.integer,s.nullablein the rig.ts file header but not in the SKILL.md schema helpers table. These should be added.noUnusedLocalsand multi-agent programs — this is the most common authoring mistake for newcomers.Tasks run today
p.bashands.enump.bashcalls ands.arrayof nesteds.objectp.bash,s.record(s.number), ands.enump.read,s.boolean,s.enum— FAILED (noUnusedLocalsrejects intermediate agent)p.bashgrep +p.writefor markdown output, duals.enumfields