annotate-source-fileslisted
Install: claude install-skill pjt222/agent-almanac
# Annotate Source Files
Add PUT workflow annotations to source files so putior can extract structured workflow data and generate Mermaid diagrams.
## When to Use
- After analyzing a codebase with `analyze-codebase-workflow` and having an annotation plan
- Adding workflow documentation to new or existing source files
- Enriching auto-detected workflows with manual labels and connections
- Documenting data pipelines, ETL processes, or multi-step computations
## Inputs
- **Required**: Source files to annotate
- **Required**: Annotation plan or knowledge of the workflow steps
- **Optional**: Style preference: single-line or multiline (default: single-line)
- **Optional**: Whether to use `put_generate()` for skeleton generation (default: yes)
## Procedure
### Step 1: Determine Comment Prefix
Each language has a specific comment prefix for PUT annotations. Use `get_comment_prefix()` to find the correct one.
```r
library(putior)
# Common prefixes
get_comment_prefix("R") # "#"
get_comment_prefix("py") # "#"
get_comment_prefix("sql") # "--"
get_comment_prefix("js") # "//"
get_comment_prefix("ts") # "//"
get_comment_prefix("go") # "//"
get_comment_prefix("rs") # "//"
get_comment_prefix("m") # "%"
get_comment_prefix("lua") # "--"
```
**Got:** A string like `"#"`, `"--"`, `"//"`, or `"%"`.
> **Line and block comments:** putior detects annotations in both line comments (`//`, `#`, `--`) and C-style block comments (`/* */`, `/** */`). For JS/TS, both `//` and