tn-bug-scan
Skill2 starsChanged 8 months agoMITView on GitHub
Deep bug hunt for the telcoin-network codebase (Rust + Solidity submodule) across 9 phases with specialized agents. Bug-hunter framing — asks 'how does this fail in production?' not 'how does an attacker exploit this?'. Covers concurrency, determinism, consensus correctness, state atomicity, panic surface, fork risk, and error propagation. Produces bug tickets with repro + failure mode per finding. Triggers on /tn-bug-scan or tn bug scan or telcoin bug hunt.
In this repository36 other files it gives its agents.
- agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- create-agentSkill
- doc-writerSkill
- feynman-auditorSkill
- gh-issueSkill
- human-writingSkill
- mermaidSkill
- nemesis-ogSkill
- nemesis-scanSkill
- outline-codeSkill
- report-to-pr-commentsSkill
- skill-creatorSkill
- solidity-security-scanSkill
- state-inconsistency-auditorSkill
- telx-reviewSkill
- tn-add-benchmarkSkill
- tn-debug-e2eSkill
- tn-domain-consensusSkill
- tn-domain-contractsSkill
- tn-domain-epochSkill
- tn-domain-executionSkill
- tn-domain-networkingSkill
- tn-domain-storageSkill
- tn-domain-workerSkill
- tn-hardenSkill
- tn-nemesis-scanSkill
- tn-review-contractsSkill
- tn-reviewSkill
- tn-rust-engineerSkill
- tn-rust-skillsSkill
- tn-security-evalSkill
- tn-threat-modelSkill
- tn-write-crate-docSkill
- tn-write-e2eSkill
- tn-write-proptestSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
Default target = current branch PR diff vs main (.rs and .sol files only).
- Distinctive: line 45
If the diff is empty, tell the user the branch has no Rust/Solidity changes and stop.
- Very specific: line 130
After the orchestrator returns, relay its summary to the user with paths to both report files.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
tn-bug-scan
Deep bug hunt for telcoin-network. Nine phases of iterative Feynman + state-check analysis, reframed from adversarial auditing to production-failure hunting. Output: bug tickets with concrete repro conditions, failure mode, affected invariant, and recommended fix.
Activation
- User says
/tn-bug-scan,tn bug scan,telcoin bug hunt,bug scan telcoin, orhunt bugs in tn - User wants to find correctness failures (crash / stall / fork / divergence / silent wrong state) in telcoin-network code
Different from /tn-nemesis-scan: tn-bug-scan produces bug tickets framed around production events; tn-nemesis-scan produces attack paths framed around adversaries. Same codebase, different lens.
Invocation Format
/tn-bug-scan [target] [--full] [--path <glob>] [--hints "..."] [--fresh]Default target = current branch PR diff vs main (.rs and .sol files only).
Examples:
/tn-bug-scan— scan the current branch's changes vs main/tn-bug-scan --full— scan all ofcrates/+tn-contracts/src//tn-bug-scan --path "crates/consensus/primary/**/*.rs"— glob-scoped scan/tn-bug-scan crates/state-sync/ --hints "certificate fetcher race"— explicit target + hints/tn-bug-scan --fresh— force Phase -1 domain-pattern regeneration
Execution
Step 1: Resolve Target Scope
--full→ target =crates/+tn-contracts/src/(entire Rust + Solidity tree, excluding tests)--path <glob>→ target = the glob (can repeat the flag for multiple globs)- Explicit
[target]arg → target = the user-supplied arg - No arg, no flag → target = current branch PR diff vs
main, filtered to.rsand.sol:
If the diff is empty, tell the user the branch has no Rust/Solidity changes and stop.git -C /Users/grant/coding/telcoin/telcoin-network diff --name-only main...HEAD \ | grep -E '\.(rs|sol)$' \ | grep -v -E '(test|bench|e2e-tests|test_utils)'
Step 2: Parse Optional Arguments
--hints— extract the quoted string after--hints. Default:"none".--fresh— if present, skip the cache check and force Phase -1 re-discovery.
Step 3: Resolve Paths
- Target repo path:
/Users/grant/coding/telcoin/telcoin-network - Skill references path (absolute): compute from this skill's location; should resolve to
.../skills/tn-bug-scan/references/
Step 4: Create Output Directories
mkdir -p /Users/grant/coding/telcoin/telcoin-network/.audit/tn-bug-scan/research
mkdir -p /Users/grant/coding/telcoin/telcoin-network/.audit/findingsStep 5: Cache Check
Determine if Phase -1 domain discovery is needed.
if [ -f /Users/grant/coding/telcoin/telcoin-network/.audit/bug-domain-patterns.md ]; then
head -5 /Users/grant/coding/telcoin/telcoin-network/.audit/bug-domain-patterns.md
fi
git -C /Users/grant/coding/telcoin/telcoin-network rev-parse --short HEADThe cache is valid when ALL of:
- The file exists
- The
_Git hash:_line matches currentgit rev-parse --short HEAD - The
_Target scope:_line matches the requested scope - The
_User hints:_line matches the provided hints - The
--freshflag was NOT passed
Set discovery_needed = true if the cache is invalid or missing. Set discovery_needed = false if the cache is valid.
Step 6: Spawn the Orchestrator
Agent({
subagent_type: "tn-bug-orchestrator",
description: "Run tn-bug-scan pipeline",
prompt: "Run the full tn-bug-scan pipeline on the following target scope.
Target scope: [resolved target from Step 1 — list of files/directories]
Target repo path: /Users/grant/coding/telcoin/telcoin-network
References path: [absolute path to skills/tn-bug-scan/references/]
Domain hints: [user hints or 'none']
Discovery needed: [true/false]
All agents MUST read references/bug-core-rules.md, references/bug-patterns.md, and references/tn-hotspots.md.
Phase 7 (reporter) MUST follow references/bug-ticket-format.md exactly.
[If discovery_needed is true:]
Run Phase -1 (Domain Discovery) FIRST:
- Phase -1a: Spawn tn-bug-strategy with target scope, hints, references path
- Phase -1b: Spawn parallel tn-bug-researcher agents (one per research topic)
- Phase -1c: Compile fragments into .audit/bug-domain-patterns.md with cache metadata
[If discovery_needed is false:]
Skip Phase -1. Domain patterns cached at .audit/bug-domain-patterns.md. Verify the file exists and is non-empty before proceeding; if missing, run Phase -1 anyway.
Then execute all 9 phases in order, with all agents reading .audit/bug-domain-patterns.md for domain context:
- Phase 0+1 (parallel): tn-bug-recon + tn-bug-mapper
- Phase 2: tn-bug-feynman (full mode)
- Phase 3: tn-bug-state-check (full mode)
- Phase 4: feedback loop (max 3 iterations; spawn tn-bug-feynman and tn-bug-state-check in targeted mode per iteration)
- Phase 5: tn-bug-scenario
- Phase 6: tn-bug-verifier (loads tn-domain-* skills as needed for invariant cross-check)
- Phase 7: tn-bug-reporter
Write phase outputs to /Users/grant/coding/telcoin/telcoin-network/.audit/tn-bug-scan/
Write final reports to:
/Users/grant/coding/telcoin/telcoin-network/.audit/findings/tn-bug-scan-verified.md
/Users/grant/coding/telcoin/telcoin-network/.audit/findings/tn-bug-scan-raw.md
Present a concise summary when complete."
})Step 7: Relay Orchestrator Summary
After the orchestrator returns, relay its summary to the user with paths to both report files. If CRITICAL findings include an escalation recommendation to tn-security-eval, surface that recommendation in the summary.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

