solidity-argus 0.1.7 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +161 -1
  2. package/package.json +5 -2
  3. package/skills/README.md +63 -0
  4. package/skills/checklists/cyfrin-defi-core/SKILL.md +3 -0
  5. package/skills/manifests/cyfrin.json +16 -0
  6. package/skills/manifests/defifofum.json +25 -0
  7. package/skills/manifests/kadenzipfel.json +48 -0
  8. package/skills/manifests/scvd.json +9 -0
  9. package/skills/manifests/smartbugs.json +11 -0
  10. package/skills/manifests/solodit.json +9 -0
  11. package/skills/manifests/sunweb3sec.json +11 -0
  12. package/skills/manifests/trailofbits.json +9 -0
  13. package/skills/methodology/audit-workflow/SKILL.md +3 -0
  14. package/skills/patterns/access-control.yaml +31 -0
  15. package/skills/patterns/erc4626.yaml +29 -0
  16. package/skills/patterns/flash-loan.yaml +20 -0
  17. package/skills/patterns/oracle.yaml +30 -0
  18. package/skills/patterns/proxy.yaml +30 -0
  19. package/skills/patterns/reentrancy.yaml +30 -0
  20. package/skills/patterns/signature.yaml +31 -0
  21. package/skills/protocol-patterns/amm-dex/SKILL.md +3 -0
  22. package/skills/references/exploit-reference/SKILL.md +3 -0
  23. package/skills/vulnerability-patterns/access-control/SKILL.md +13 -0
  24. package/skills/vulnerability-patterns/authorization-txorigin/SKILL.md +6 -0
  25. package/skills/vulnerability-patterns/delegatecall-untrusted-callee/SKILL.md +6 -0
  26. package/skills/vulnerability-patterns/dos-revert/SKILL.md +13 -1
  27. package/skills/vulnerability-patterns/flash-loan-attacks/SKILL.md +12 -0
  28. package/skills/vulnerability-patterns/oracle-manipulation/SKILL.md +13 -0
  29. package/skills/vulnerability-patterns/overflow-underflow/SKILL.md +10 -1
  30. package/skills/vulnerability-patterns/reentrancy/SKILL.md +13 -0
  31. package/skills/vulnerability-patterns/signature-malleability/SKILL.md +9 -0
  32. package/skills/vulnerability-patterns/unchecked-return-values/SKILL.md +11 -0
  33. package/src/agents/argus-prompt.ts +7 -7
  34. package/src/agents/pythia-prompt.ts +11 -11
  35. package/src/agents/scribe-prompt.ts +6 -6
  36. package/src/agents/sentinel-prompt.ts +7 -7
  37. package/src/cli/cli-output.ts +16 -0
  38. package/src/cli/cli-program.ts +9 -5
  39. package/src/cli/commands/doctor.ts +274 -16
  40. package/src/cli/commands/init.ts +5 -5
  41. package/src/cli/commands/install.ts +5 -5
  42. package/src/cli/commands/lint-skills.ts +114 -0
  43. package/src/cli/tui-prompts.ts +4 -2
  44. package/src/config/schema.ts +2 -0
  45. package/src/create-hooks.ts +141 -32
  46. package/src/create-tools.ts +2 -0
  47. package/src/features/error-recovery/session-recovery.ts +7 -1
  48. package/src/features/error-recovery/tool-error-recovery.ts +74 -19
  49. package/src/features/persistent-state/audit-state-manager.ts +36 -13
  50. package/src/hooks/agent-tracker.ts +53 -0
  51. package/src/hooks/compaction-hook.ts +46 -37
  52. package/src/hooks/config-handler.ts +22 -9
  53. package/src/hooks/context-budget.ts +45 -0
  54. package/src/hooks/event-hook-v2.ts +8 -2
  55. package/src/hooks/event-hook.ts +5 -4
  56. package/src/hooks/knowledge-sync-hook.ts +2 -1
  57. package/src/hooks/recon-context-builder.ts +66 -0
  58. package/src/hooks/safe-create-hook.ts +4 -5
  59. package/src/hooks/system-prompt-hook.ts +92 -221
  60. package/src/hooks/tool-tracking-hook.ts +108 -9
  61. package/src/hooks/types.ts +0 -1
  62. package/src/index.ts +28 -6
  63. package/src/knowledge/retry.ts +53 -0
  64. package/src/knowledge/scvd-client.ts +37 -10
  65. package/src/knowledge/scvd-errors.ts +89 -0
  66. package/src/knowledge/scvd-index.ts +53 -3
  67. package/src/knowledge/scvd-sync.ts +205 -34
  68. package/src/knowledge/source-manifest.ts +102 -0
  69. package/src/plugin-interface.ts +11 -3
  70. package/src/shared/binary-utils.ts +1 -0
  71. package/src/shared/logger.ts +78 -17
  72. package/src/skills/argus-skill-resolver.ts +226 -0
  73. package/src/skills/skill-schema.ts +98 -0
  74. package/src/state/audit-state.ts +2 -0
  75. package/src/state/types.ts +32 -1
  76. package/src/tools/argus-skill-load-tool.ts +73 -0
  77. package/src/tools/pattern-checker-tool.ts +56 -12
  78. package/src/tools/pattern-loader.ts +183 -0
  79. package/src/tools/pattern-schema.ts +51 -0
  80. package/src/tools/report-generator-tool.ts +134 -11
  81. package/src/tools/slither-tool.ts +61 -19
  82. package/src/tools/solodit-search-tool.ts +92 -14
  83. package/src/utils/audit-artifact-detector.ts +119 -0
  84. package/src/utils/dependency-scanner.ts +93 -0
  85. package/src/utils/project-detector.ts +128 -26
  86. package/src/utils/solidity-parser.ts +20 -4
  87. package/src/utils/solodit-health.ts +29 -0
@@ -0,0 +1,31 @@
1
+ pack_name: signature
2
+ pack_version: "1.0"
3
+ patterns:
4
+ - name: replay-attack
5
+ category: signature
6
+ severity: High
7
+ swc: SWC-117
8
+ confidence: Medium
9
+ version: "1.0"
10
+ regex: 'ecrecover|ECDSA\.recover'
11
+ description: Signature recovery without nonce tracking — signatures may be replayed across transactions or chains if nonce and chainId are not included in signed data
12
+ remediation: Include nonce, chainId, and contract address in signed message hash; increment nonce after use; use EIP-712 typed structured data
13
+
14
+ - name: sig-malleability
15
+ category: signature
16
+ severity: Medium
17
+ swc: SWC-117
18
+ confidence: Medium
19
+ version: "1.0"
20
+ regex: ecrecover
21
+ description: Raw ecrecover usage — ECDSA signatures are malleable (s-value can be flipped) allowing signature reuse if not checked against canonical form
22
+ remediation: Use OpenZeppelin ECDSA.recover which enforces s <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0; reject non-canonical signatures
23
+
24
+ - name: missing-nonce
25
+ category: signature
26
+ severity: High
27
+ confidence: Medium
28
+ version: "1.0"
29
+ regex: 'permit\(|signTypedData'
30
+ description: Permit or typed data signing without nonce validation — missing nonce allows signature replay after the original transaction is executed
31
+ remediation: Track per-address nonces mapping(address => uint256); include nonce in EIP-712 struct; increment nonce on each use
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  name: amm-dex
3
3
  description: AMM and DEX security patterns covering pricing, LP accounting, MEV, and swap invariants.
4
+ source_url: https://github.com/DeFiFoFum/fofum-solidity-skills
5
+ source_license: MIT
6
+ imported_at: "2025-01-15T00:00:00Z"
4
7
  ---
5
8
  <!-- Source: DeFiFoFum/fofum-solidity-skills (MIT) -->
6
9
 
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  name: exploit-reference
3
3
  description: Reference guide to major DeFi exploits and reproducible Foundry workflows from DeFiHackLabs
4
+ source_url: https://github.com/SunWeb3Sec/DeFiHackLabs
5
+ source_license: reference-only
6
+ imported_at: "2025-01-15T00:00:00Z"
4
7
  ---
5
8
  <!-- Source: SunWeb3Sec/DeFiHackLabs (reference only, no license) -->
6
9
 
@@ -1,6 +1,19 @@
1
1
  ---
2
2
  name: access-control
3
3
  description: Access-control exploit patterns and secure authorization approaches for privileged Solidity functions.
4
+ source_url: https://github.com/kadenzipfel/smart-contract-vulnerabilities
5
+ source_license: MIT
6
+ imported_at: "2025-01-15T00:00:00Z"
7
+ detection_rules:
8
+ - regex: 'onlyOwner'
9
+ severity: Medium
10
+ confidence: Medium
11
+ description: Privileged modifier usage that requires authorization review
12
+ - regex: 'require\(msg\.sender'
13
+ severity: Medium
14
+ confidence: Medium
15
+ swc: SWC-105
16
+ description: Inline sender authorization check on sensitive paths
4
17
  ---
5
18
 
6
19
  <!-- Source: DeFiFoFum/fofum-solidity-skills (MIT) -->
@@ -1,6 +1,12 @@
1
1
  ---
2
2
  name: authorization-txorigin
3
3
  description: - Contract uses `tx.origin` for authorization or access control checks (e.g., `require(tx.origin == owner)`)
4
+ detection_rules:
5
+ - regex: 'tx\.origin'
6
+ severity: High
7
+ confidence: High
8
+ swc: SWC-115
9
+ description: tx.origin usage in authorization logic is phishing-prone
4
10
  ---
5
11
  <!-- Source: kadenzipfel/smart-contract-vulnerabilities (MIT) -->
6
12
 
@@ -1,6 +1,12 @@
1
1
  ---
2
2
  name: delegatecall-untrusted-callee
3
3
  description: - Contract uses `delegatecall`
4
+ detection_rules:
5
+ - regex: 'delegatecall'
6
+ severity: High
7
+ confidence: High
8
+ swc: SWC-112
9
+ description: Delegatecall usage where callee trust boundary must be verified
4
10
  ---
5
11
  <!-- Source: kadenzipfel/smart-contract-vulnerabilities (MIT) -->
6
12
 
@@ -1,6 +1,18 @@
1
1
  ---
2
2
  name: dos-revert
3
- description: - Critical contract logic depends on an external call succeeding
3
+ description: Denial-of-service attacks through unexpected reverts in external calls
4
+ source_url: https://github.com/kadenzipfel/smart-contract-vulnerabilities
5
+ source_license: MIT
6
+ imported_at: "2025-01-15T00:00:00Z"
7
+ detection_rules:
8
+ - regex: 'require\(.*\.send'
9
+ severity: Medium
10
+ confidence: Medium
11
+ description: Require-on-send pattern can cause full-transaction DoS
12
+ - regex: 'for\s*\('
13
+ severity: Low
14
+ confidence: Low
15
+ description: Loop construct that may combine with external calls for DoS risk
4
16
  ---
5
17
  <!-- Source: kadenzipfel/smart-contract-vulnerabilities (MIT) -->
6
18
 
@@ -1,6 +1,18 @@
1
1
  ---
2
2
  name: flash-loan-attacks
3
3
  description: Flash-loan attack mechanics, exploit archetypes, and mitigations for capital-amplified threats.
4
+ source_url: https://github.com/kadenzipfel/smart-contract-vulnerabilities
5
+ source_license: MIT
6
+ imported_at: "2025-01-15T00:00:00Z"
7
+ detection_rules:
8
+ - regex: 'flashLoan\('
9
+ severity: High
10
+ confidence: High
11
+ description: Flash loan primitive usage that can amplify economic attacks
12
+ - regex: 'balanceOf\(address\(this\)\)'
13
+ severity: Medium
14
+ confidence: Medium
15
+ description: In-transaction balance checks often used in flash-loan-sensitive logic
4
16
  ---
5
17
 
6
18
  <!-- Source: DeFiFoFum/fofum-solidity-skills (MIT) -->
@@ -1,6 +1,19 @@
1
1
  ---
2
2
  name: oracle-manipulation
3
3
  description: Oracle manipulation techniques, case studies, and secure pricing integration controls for DeFi.
4
+ source_url: https://github.com/kadenzipfel/smart-contract-vulnerabilities
5
+ source_license: MIT
6
+ imported_at: "2025-01-15T00:00:00Z"
7
+ detection_rules:
8
+ - regex: 'latestRoundData'
9
+ severity: Medium
10
+ confidence: High
11
+ swc: SWC-116
12
+ description: Chainlink price reads requiring freshness and sanity checks
13
+ - regex: 'getReserves\('
14
+ severity: High
15
+ confidence: High
16
+ description: AMM reserve spot-price usage vulnerable to manipulation
4
17
  ---
5
18
 
6
19
  <!-- Source: DeFiFoFum/fofum-solidity-skills (MIT) -->
@@ -1,6 +1,15 @@
1
1
  ---
2
2
  name: overflow-underflow
3
- description: - Solidity <0.8.0 without SafeMath, OR
3
+ description: Integer overflow and underflow vulnerabilities in Solidity contracts
4
+ source_url: https://github.com/kadenzipfel/smart-contract-vulnerabilities
5
+ source_license: MIT
6
+ imported_at: "2025-01-15T00:00:00Z"
7
+ detection_rules:
8
+ - regex: 'unchecked\s*\{'
9
+ severity: Medium
10
+ confidence: High
11
+ swc: SWC-101
12
+ description: Unchecked arithmetic block requiring manual overflow review
4
13
  ---
5
14
  <!-- Source: kadenzipfel/smart-contract-vulnerabilities (MIT) -->
6
15
 
@@ -1,6 +1,19 @@
1
1
  ---
2
2
  name: reentrancy
3
3
  description: Reentrancy attack patterns, real incidents, and defensive coding checks for Solidity protocols.
4
+ source_url: https://github.com/kadenzipfel/smart-contract-vulnerabilities
5
+ source_license: MIT
6
+ imported_at: "2025-01-15T00:00:00Z"
7
+ detection_rules:
8
+ - regex: '\.call\{value:'
9
+ severity: High
10
+ confidence: High
11
+ swc: SWC-107
12
+ description: External value transfer via low-level call before effects
13
+ - regex: '\.call\{.*\}\('
14
+ severity: Medium
15
+ confidence: Medium
16
+ description: Low-level external call that can open a reentrancy window
4
17
  ---
5
18
 
6
19
  <!-- Source: DeFiFoFum/fofum-solidity-skills (MIT) -->
@@ -1,6 +1,15 @@
1
1
  ---
2
2
  name: signature-malleability
3
3
  description: - Contract uses ECDSA signatures for authorization or deduplication
4
+ detection_rules:
5
+ - regex: 'ecrecover'
6
+ severity: Medium
7
+ confidence: High
8
+ description: Raw ecrecover usage needs strict signature normalization checks
9
+ - regex: 'ECDSA'
10
+ severity: Low
11
+ confidence: Medium
12
+ description: Signature verification path to inspect for nonce and domain separation
4
13
  ---
5
14
  <!-- Source: kadenzipfel/smart-contract-vulnerabilities (MIT) -->
6
15
 
@@ -1,6 +1,17 @@
1
1
  ---
2
2
  name: unchecked-return-values
3
3
  description: - Contract uses low-level calls: `.call()`, `.send()`, or `.delegatecall()`
4
+ detection_rules:
5
+ - regex: '\.call\{'
6
+ severity: Medium
7
+ confidence: Medium
8
+ swc: SWC-104
9
+ description: Low-level call usage requires explicit success handling
10
+ - regex: '\.send\('
11
+ severity: Medium
12
+ confidence: High
13
+ swc: SWC-104
14
+ description: send return value can fail silently if unchecked
4
15
  ---
5
16
  <!-- Source: kadenzipfel/smart-contract-vulnerabilities (MIT) -->
6
17
 
@@ -269,17 +269,17 @@ Your subagents have access to these specialized tools. Know when to delegate eac
269
269
 
270
270
  ## SKILL SYSTEM
271
271
 
272
- You have access to OpenCode Skills through the \`skill\` tool. Skills are specialized knowledge modules and must be used proactively when they improve audit accuracy.
272
+ Instruct subagents to use \`argus_skill_load\` only when domain-specific context is needed. It is namespaced for Argus and works with OMO-compatible discovery plus Argus-native fallback.
273
273
 
274
274
  - **Curated skill map (load these first)**:
275
- - **Reconnaissance**: \`protocol-patterns/amm-dex\`, \`protocol-patterns/lending-borrowing\`, \`protocol-patterns/bridges-cross-chain\`
276
- - **Manual Review**: \`vulnerability-patterns/reentrancy\`, \`vulnerability-patterns/oracle-manipulation\`, \`vulnerability-patterns/access-control\`
277
- - **Verification**: \`checklists/cyfrin-defi-core\`, \`methodology/severity-classification\`, \`methodology/report-template\`
275
+ - **Reconnaissance**: \`amm-dex\`, \`lending-borrowing\`, \`bridges-cross-chain\`
276
+ - **Manual Review**: \`reentrancy\`, \`oracle-manipulation\`, \`access-control\`
277
+ - **Verification**: \`cyfrin-defi-core\`, \`severity-classification\`, \`report-template\`
278
278
 
279
279
  - **Deterministic trigger rules**:
280
- - If the protocol uses AMM reserves or pool math, load \`protocol-patterns/amm-dex\` before Attack Surface Mapping.
281
- - If price feeds or spot prices influence critical state changes, load \`vulnerability-patterns/oracle-manipulation\` before severity assessment.
282
- - If proxy/upgrade patterns are present, load \`checklists/cyfrin-best-practices-upgrades\` before final recommendations.
280
+ - If the protocol uses AMM reserves or pool math, load \`amm-dex\` via \`argus_skill_load\` before Attack Surface Mapping.
281
+ - If price feeds or spot prices influence critical state changes, load \`oracle-manipulation\` via \`argus_skill_load\` before severity assessment.
282
+ - If proxy/upgrade patterns are present, load \`cyfrin-best-practices-upgrades\` via \`argus_skill_load\` before final recommendations.
283
283
 
284
284
  - **Trail of Bits skills**:
285
285
  - For pre-audit deep context modeling and attack-surface grounding: \`audit-context-building\`
@@ -91,20 +91,20 @@ OpenCode has a powerful **Skills** system that allows you to load specialized kn
91
91
 
92
92
  **How to use**:
93
93
  - Load a relevant skill before deep research when protocol context is non-trivial.
94
- - Prioritize \`vulnerability-patterns/*\`, \`protocol-patterns/*\`, and \`references/*\` skills for exploit precedent mapping.
95
- - Use the \`skill\` tool directly when available to load the exact skill you need.
94
+ - Prioritize vulnerability pattern skills, protocol pattern skills, and reference skills for exploit precedent mapping.
95
+ - Use \`argus_skill_load\` only when specialized context is needed, and load the exact skill you need.
96
96
  - **Curated skill map**:
97
- - \`vulnerability-patterns/reentrancy\`, \`vulnerability-patterns/oracle-manipulation\`, \`vulnerability-patterns/flash-loan-attacks\`
98
- - \`protocol-patterns/lending-borrowing\`, \`protocol-patterns/amm-dex\`
99
- - \`references/exploit-reference\`
97
+ - \`reentrancy\`, \`oracle-manipulation\`, \`flash-loan-attacks\`
98
+ - \`lending-borrowing\`, \`amm-dex\`
99
+ - \`exploit-reference\`
100
100
  - **Deterministic trigger rules**:
101
- - If you investigate spot-price dependencies, load \`vulnerability-patterns/oracle-manipulation\` first.
102
- - If capital-efficient attacks or same-block loops are plausible, load \`vulnerability-patterns/flash-loan-attacks\` first.
103
- - If the protocol integrates arbitrary ERC20s, load ToB \`token-integration-analyzer\` (building-secure-contracts plugin) before recommendation drafting.
101
+ - If you investigate spot-price dependencies, load \`oracle-manipulation\` with \`argus_skill_load\` first.
102
+ - If capital-efficient attacks or same-block loops are plausible, load \`flash-loan-attacks\` with \`argus_skill_load\` first.
103
+ - If the protocol integrates arbitrary ERC20s, load ToB \`token-integration-analyzer\` (building-secure-contracts plugin) with \`argus_skill_load\` before recommendation drafting.
104
104
  - **Examples**:
105
- - "I am loading \`reentrancy\` to cross-reference known exploit patterns and missed edge cases."
106
- - "I am loading \`lending-borrowing\` to map lending-specific oracle and liquidation failure modes."
107
- - "I am loading \`audit-context-building\` (Trail of Bits) to build a line-by-line system model before vulnerability hypothesis generation."
105
+ - "I am loading \`reentrancy\` to cross-reference known exploit patterns and missed edge cases."
106
+ - "I am loading \`lending-borrowing\` to map lending-specific oracle and liquidation failure modes."
107
+ - "I am loading \`audit-context-building\` (Trail of Bits) to build a line-by-line system model before vulnerability hypothesis generation."
108
108
  - You are a generalist researcher. Use Skills to become a specialist on demand.
109
109
 
110
110
  ## OUTPUT FORMAT
@@ -62,15 +62,15 @@ Before generating the report, verify:
62
62
 
63
63
  ## SKILL SYSTEM
64
64
 
65
- Use the \`skill\` tool when needed to improve report quality and consistency.
65
+ Use \`argus_skill_load\` only when needed to improve report quality and consistency.
66
66
 
67
67
  - **Curated skill map**:
68
- - \`methodology/report-template\`, \`methodology/severity-classification\`
69
- - \`checklists/cyfrin-defi-core\`
70
- - \`references/exploit-reference\`
68
+ - \`report-template\`, \`severity-classification\`
69
+ - \`cyfrin-defi-core\`
70
+ - \`exploit-reference\`
71
71
  - **Deterministic trigger rules**:
72
- - If severity wording drifts, load \`methodology/severity-classification\` before publishing.
73
- - If recommendation quality is generic, load \`checklists/cyfrin-defi-core\` before final edits.
72
+ - If severity wording drifts, load \`severity-classification\` with \`argus_skill_load\` before publishing.
73
+ - If recommendation quality is generic, load \`cyfrin-defi-core\` with \`argus_skill_load\` before final edits.
74
74
 
75
75
  ## OUTPUT FORMAT
76
76
 
@@ -89,16 +89,16 @@ You have access to a specific set of tools. Use them effectively.
89
89
 
90
90
  ## SKILL SYSTEM
91
91
 
92
- Use the \`skill\` tool to load specialized skills before deep verification work.
92
+ Use \`argus_skill_load\` only when specialized context is needed before deep verification work.
93
93
 
94
94
  - **Curated skill map**:
95
- - \`vulnerability-patterns/reentrancy\`, \`vulnerability-patterns/access-control\`, \`vulnerability-patterns/oracle-manipulation\`
96
- - \`checklists/cyfrin-defi-integrations\`, \`methodology/severity-classification\`
97
- - Trail of Bits: \`property-based-testing\`, \`variant-analysis\`
95
+ - \`reentrancy\`, \`access-control\`, \`oracle-manipulation\`
96
+ - \`cyfrin-defi-integrations\`, \`severity-classification\`
97
+ - Trail of Bits: \`property-based-testing\`, \`variant-analysis\`
98
98
  - **Deterministic trigger rules**:
99
- - If external calls and mutable state interleave, load \`vulnerability-patterns/reentrancy\` before writing PoCs.
100
- - If privileged flows are central to the finding, load \`vulnerability-patterns/access-control\` before severity scoring.
101
- - If fuzzing strategy is unclear, load ToB \`property-based-testing\` before selecting invariants.
99
+ - If external calls and mutable state interleave, load \`reentrancy\` with \`argus_skill_load\` before writing PoCs.
100
+ - If privileged flows are central to the finding, load \`access-control\` with \`argus_skill_load\` before severity scoring.
101
+ - If fuzzing strategy is unclear, load ToB \`property-based-testing\` with \`argus_skill_load\` before selecting invariants.
102
102
 
103
103
  ## OUTPUT FORMAT
104
104
 
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Thin CLI output abstraction for user-facing CLI output.
3
+ * Distinct from createLogger() which writes structured logs to file (~/.cache/solidity-argus/argus.log).
4
+ * CLI output goes to stdout/stderr for user-visible formatted output (doctor reports, init messages, etc.)
5
+ */
6
+ export const cliOutput = {
7
+ log(...args: unknown[]): void {
8
+ console.log(...args)
9
+ },
10
+ warn(...args: unknown[]): void {
11
+ console.warn(...args)
12
+ },
13
+ error(...args: unknown[]): void {
14
+ console.error(...args)
15
+ },
16
+ }
@@ -2,13 +2,16 @@ import type { CliCommand } from "./types";
2
2
  import { doctorCommand } from "./commands/doctor";
3
3
  import { initCommand } from "./commands/init";
4
4
  import { installCommand } from "./commands/install";
5
+ import { lintSkillsCommand } from "./commands/lint-skills";
6
+ import { cliOutput } from "./cli-output";
5
7
 
6
8
  const HELP_TEXT = `argus — Solidity Security Auditor for OpenCode
7
9
 
8
10
  Commands:
9
- doctor Check Slither/Foundry installation and config health
10
- init Create solidity-argus config file
11
- install Configure argus plugin in opencode config
11
+ doctor Check Slither/Foundry installation and config health
12
+ init Create solidity-argus config file
13
+ install Configure argus plugin in opencode config
14
+ lint-skills Validate SKILL.md files against schema
12
15
  `;
13
16
 
14
17
  export class CliProgram {
@@ -22,13 +25,13 @@ export class CliProgram {
22
25
  const subcommand = args[0];
23
26
 
24
27
  if (!subcommand || subcommand === "--help" || subcommand === "-h") {
25
- console.log(HELP_TEXT);
28
+ cliOutput.log(HELP_TEXT);
26
29
  return 0;
27
30
  }
28
31
 
29
32
  const command = this.commands.get(subcommand);
30
33
  if (!command) {
31
- console.error(`Error: Unknown command '${subcommand}'. Run 'argus' for help.`);
34
+ cliOutput.error(`Unknown command '${subcommand}'. Run 'argus' for help.`);
32
35
  return 1;
33
36
  }
34
37
 
@@ -41,5 +44,6 @@ export function createCliProgram(): CliProgram {
41
44
  program.registerCommand(doctorCommand);
42
45
  program.registerCommand(initCommand);
43
46
  program.registerCommand(installCommand);
47
+ program.registerCommand(lintSkillsCommand);
44
48
  return program;
45
49
  }