Documentation Reconnaissance Methodology
Purpose
Rapidly understand what the protocol should do through documentation analysis.
This is reconnaissance, not code analysis.
1. Documentation Discovery
Search Patterns
Glob("**/README*")
Glob("**/*.md")
Glob("**/docs/**/*")
Glob("**/SECURITY*")
Glob("**/*.pdf")
Priority Order
| Priority |
File |
What to Extract |
| 1 |
Root README |
Project overview, quick start |
| 2 |
docs/README.md |
Documentation entry point |
| 3 |
SECURITY.md |
Security considerations, contacts |
| 4 |
Whitepaper/spec |
Formal specification |
| 5 |
Audit reports |
Known issues, past findings |
Skip These
- Code files (
.sol, .rs, etc.)
- Test documentation
- CI/CD configuration
2. The 4 Essential Questions
Question 1: Where Is the Money?
| Asset Type |
What to Look For |
| Native tokens |
ETH, MATIC, AVAX holdings |
| ERC20 tokens |
USDC, USDT, DAI, protocol tokens |
| LP tokens |
Uniswap, Curve, Balancer positions |
| NFTs |
ERC721, ERC1155 assets |
| Shares/receipts |
Vault shares, staked positions |
Extract: Which contracts hold assets, TVL mentions, treasury.
Question 2: Who Can Move the Money?
User Paths:
| Action |
Function Names |
| Deposit |
deposit(), stake(), supply(), mint() |
| Withdraw |
withdraw(), unstake(), redeem(), burn() |
Privileged Paths:
| Action |
Function Names |
Risk Level |
| Emergency |
emergencyWithdraw(), pause() |
High |
| Recovery |
sweep(), rescue(), skim() |
High |
| Config |
setFee(), setOracle(), upgradeTo() |
Medium |
Extract: Function names, who can call, conditions.
Question 3: What Invariants Must Hold?
Explicit Invariants - Keywords:
- "must", "always", "never", "guaranteed", "ensures"
- Mathematical relationships:
x + y = z, a <= b * c
- NatSpec:
@invariant, @notice
Implicit Invariants - By Protocol Type:
| Protocol Type |
Common Invariant |
| Vault |
totalAssets >= totalShares * minPrice |
| Lending |
userDebt <= userCollateral * LTV |
| AMM |
reserveX * reserveY >= k |
| Staking |
sum(userStakes) == totalStaked |
| Bridge |
mintedOnL2 == lockedOnL1 |
Mark inferred invariants with [INFERRED].
Question 4: What Trust Assumptions Exist?
| Trusted Party |
What They Control |
Questions to Answer |
| Owner |
Contract upgrades |
Timelock? Multisig? |
| Admin |
Parameter changes |
Bounds? Frequency? |
| Oracle |
Price feeds |
Freshness? Backup? |
| Keeper |
Liquidations |
Incentives? Constraints? |
Extract: Who is trusted, for what, with what safeguards.
3. Protocol Type Classification
| Pattern in Docs |
Protocol Type |
Priority Vectors |
| swap, liquidity, reserves |
AMM/DEX |
Price manipulation, sandwich |
| borrow, collateral, liquidate |
Lending |
Oracle manipulation, bad debt |
| deposit, shares, yield |
Vault |
Share inflation, first depositor |
| vote, propose, execute |
Governance |
Flash loan voting, timelock |
| lock, mint, bridge |
Bridge |
Double spend, replay |
| stake, reward, epoch |
Staking |
Reward calculation, timing |
4. Extraction Process
Step 1: High-Level Understanding
Read overview documents to understand:
- Protocol purpose and value proposition
- Target users and use cases
- Integration with other protocols
- Economic model
Step 2: Mechanism Analysis
For each mechanism described:
- Identify inputs and outputs
- Note preconditions and postconditions
- Extract mathematical relationships
- Identify external dependencies
Step 3: Security Information
Look for:
- Security considerations sections
- Known limitations and risks
- Threat model descriptions
- Emergency procedures
Step 4: Gap Identification
Note what's MISSING:
- Undefined edge cases
- Unclear trust assumptions
- Missing invariants
- Ambiguous specifications
5. Quality Assessment
| Rating |
Criteria |
| Excellent |
Complete invariants, clear trust model, all mechanisms documented |
| Good |
Most information present, some inference needed |
| Adequate |
Basic coverage, significant gaps |
| Poor |
Minimal documentation, heavy inference required |
| Minimal |
Almost no documentation |
6. Edge Cases
Minimal Documentation
- Note quality as "Poor" or "Minimal"
- Flag ALL missing critical information
- Infer what possible, mark as
[INFERRED]
- Recommend documentation improvements
- Note increased audit risk
Conflicting Information
- Note the conflict explicitly
- List all versions found
- Flag for clarification
- Do not assume which is correct
Non-English Documentation
- Note the language limitation
- Extract what is possible
- Flag for native speaker review
Output
Write findings to .vigilo/recon/docs-findings.md following the format in
template.md.
Additional Resources
template.md - Output template for documentation reconnaissance findings
examples/minimal-output.md - Minimal output example for sparse documentation
1---2name: docs-analysis3description: Docs Analysis4---56# Documentation Reconnaissance Methodology78## Purpose910Rapidly understand **what the protocol should do** through documentation analysis.11This is reconnaissance, not code analysis.1213---1415## 1. Documentation Discovery1617### Search Patterns1819```20Glob("**/README*")21Glob("**/*.md")22Glob("**/docs/**/*")23Glob("**/SECURITY*")24Glob("**/*.pdf")25```2627### Priority Order2829| Priority | File | What to Extract |30|----------|------|-----------------|31| 1 | Root README | Project overview, quick start |32| 2 | docs/README.md | Documentation entry point |33| 3 | SECURITY.md | Security considerations, contacts |34| 4 | Whitepaper/spec | Formal specification |35| 5 | Audit reports | Known issues, past findings |3637### Skip These38- Code files (`.sol`, `.rs`, etc.)39- Test documentation40- CI/CD configuration4142---4344## 2. The 4 Essential Questions4546### Question 1: Where Is the Money?4748| Asset Type | What to Look For |49|------------|------------------|50| Native tokens | ETH, MATIC, AVAX holdings |51| ERC20 tokens | USDC, USDT, DAI, protocol tokens |52| LP tokens | Uniswap, Curve, Balancer positions |53| NFTs | ERC721, ERC1155 assets |54| Shares/receipts | Vault shares, staked positions |5556**Extract**: Which contracts hold assets, TVL mentions, treasury.5758### Question 2: Who Can Move the Money?5960**User Paths**:61| Action | Function Names |62|--------|---------------|63| Deposit | `deposit()`, `stake()`, `supply()`, `mint()` |64| Withdraw | `withdraw()`, `unstake()`, `redeem()`, `burn()` |6566**Privileged Paths**:67| Action | Function Names | Risk Level |68|--------|---------------|------------|69| Emergency | `emergencyWithdraw()`, `pause()` | High |70| Recovery | `sweep()`, `rescue()`, `skim()` | High |71| Config | `setFee()`, `setOracle()`, `upgradeTo()` | Medium |7273**Extract**: Function names, who can call, conditions.7475### Question 3: What Invariants Must Hold?7677**Explicit Invariants** - Keywords:78- "must", "always", "never", "guaranteed", "ensures"79- Mathematical relationships: `x + y = z`, `a <= b * c`80- NatSpec: `@invariant`, `@notice`8182**Implicit Invariants** - By Protocol Type:8384| Protocol Type | Common Invariant |85|---------------|------------------|86| Vault | `totalAssets >= totalShares * minPrice` |87| Lending | `userDebt <= userCollateral * LTV` |88| AMM | `reserveX * reserveY >= k` |89| Staking | `sum(userStakes) == totalStaked` |90| Bridge | `mintedOnL2 == lockedOnL1` |9192Mark inferred invariants with `[INFERRED]`.9394### Question 4: What Trust Assumptions Exist?9596| Trusted Party | What They Control | Questions to Answer |97|--------------|-------------------|---------------------|98| Owner | Contract upgrades | Timelock? Multisig? |99| Admin | Parameter changes | Bounds? Frequency? |100| Oracle | Price feeds | Freshness? Backup? |101| Keeper | Liquidations | Incentives? Constraints? |102103**Extract**: Who is trusted, for what, with what safeguards.104105---106107## 3. Protocol Type Classification108109| Pattern in Docs | Protocol Type | Priority Vectors |110|-----------------|---------------|------------------|111| swap, liquidity, reserves | AMM/DEX | Price manipulation, sandwich |112| borrow, collateral, liquidate | Lending | Oracle manipulation, bad debt |113| deposit, shares, yield | Vault | Share inflation, first depositor |114| vote, propose, execute | Governance | Flash loan voting, timelock |115| lock, mint, bridge | Bridge | Double spend, replay |116| stake, reward, epoch | Staking | Reward calculation, timing |117118---119120## 4. Extraction Process121122### Step 1: High-Level Understanding123124Read overview documents to understand:125- Protocol purpose and value proposition126- Target users and use cases127- Integration with other protocols128- Economic model129130### Step 2: Mechanism Analysis131132For each mechanism described:1331. Identify inputs and outputs1342. Note preconditions and postconditions1353. Extract mathematical relationships1364. Identify external dependencies137138### Step 3: Security Information139140Look for:141- Security considerations sections142- Known limitations and risks143- Threat model descriptions144- Emergency procedures145146### Step 4: Gap Identification147148Note what's MISSING:149- Undefined edge cases150- Unclear trust assumptions151- Missing invariants152- Ambiguous specifications153154---155156## 5. Quality Assessment157158| Rating | Criteria |159|--------|----------|160| Excellent | Complete invariants, clear trust model, all mechanisms documented |161| Good | Most information present, some inference needed |162| Adequate | Basic coverage, significant gaps |163| Poor | Minimal documentation, heavy inference required |164| Minimal | Almost no documentation |165166---167168## 6. Edge Cases169170### Minimal Documentation1711. Note quality as "Poor" or "Minimal"1722. Flag ALL missing critical information1733. Infer what possible, mark as `[INFERRED]`1744. Recommend documentation improvements1755. Note increased audit risk176177### Conflicting Information1781. Note the conflict explicitly1792. List all versions found1803. Flag for clarification1814. Do not assume which is correct182183### Non-English Documentation1841. Note the language limitation1852. Extract what is possible1863. Flag for native speaker review187188---189190## Output191192Write findings to `.vigilo/recon/docs-findings.md` following the format in193[`template.md`](template.md).194195---196197## Additional Resources198199- [**`template.md`**](template.md) - Output template for documentation reconnaissance findings200- [**`examples/minimal-output.md`**](examples/minimal-output.md) - Minimal output example for sparse documentation