@aragon-agent/cli 0.6.29 → 0.6.31

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 (58) hide show
  1. package/CHANGELOG.md +2123 -2103
  2. package/README.md +81 -14
  3. package/dist/agent/project-guidance-prompt.js +20 -20
  4. package/dist/cli.js +169 -56
  5. package/dist/commands/builtins.js +4 -0
  6. package/dist/commands/perf.d.ts +25 -1
  7. package/dist/commands/perf.js +26 -2
  8. package/dist/commands/registry.d.ts +6 -0
  9. package/dist/config/env.js +4 -0
  10. package/dist/config/load.d.ts +3 -1
  11. package/dist/config/load.js +12 -1
  12. package/dist/config/schema.d.ts +27 -0
  13. package/dist/config/schema.js +9 -0
  14. package/dist/config/ui-state.d.ts +9 -0
  15. package/dist/config/ui-state.js +9 -0
  16. package/dist/ui/App.d.ts +11 -1
  17. package/dist/ui/App.js +122 -62
  18. package/dist/ui/ScrollbackShell.d.ts +28 -0
  19. package/dist/ui/ScrollbackShell.js +10 -0
  20. package/dist/ui/frame-differ.d.ts +12 -0
  21. package/dist/ui/overlays/HelpOverlay.d.ts +1 -1
  22. package/dist/ui/overlays/HelpOverlay.js +21 -3
  23. package/dist/ui/screen.d.ts +16 -0
  24. package/dist/ui/screen.js +32 -0
  25. package/dist/ui/scrollback/budget.d.ts +43 -0
  26. package/dist/ui/scrollback/budget.js +44 -0
  27. package/dist/ui/scrollback/drain.d.ts +32 -0
  28. package/dist/ui/scrollback/drain.js +64 -0
  29. package/dist/ui/scrollback/exit-summary.d.ts +23 -0
  30. package/dist/ui/scrollback/exit-summary.js +25 -0
  31. package/dist/ui/scrollback/limits.d.ts +25 -0
  32. package/dist/ui/scrollback/limits.js +25 -0
  33. package/dist/ui/scrollback/live-preview.d.ts +26 -0
  34. package/dist/ui/scrollback/live-preview.js +106 -0
  35. package/dist/ui/scrollback/renderer.d.ts +38 -0
  36. package/dist/ui/scrollback/renderer.js +158 -0
  37. package/dist/ui/scrollback/scrollback-writer.d.ts +74 -0
  38. package/dist/ui/scrollback/scrollback-writer.js +263 -0
  39. package/dist/ui/scrollback/settled-boundary.d.ts +42 -0
  40. package/dist/ui/scrollback/settled-boundary.js +106 -0
  41. package/dist/ui/scrollback/use-scrollback-view.d.ts +92 -0
  42. package/dist/ui/scrollback/use-scrollback-view.js +263 -0
  43. package/dist/ui/scrollback/writer-shapes.d.ts +61 -0
  44. package/dist/ui/scrollback/writer-shapes.js +114 -0
  45. package/dist/ui/stdout-frame-writer.js +12 -2
  46. package/dist/ui/terminal-plan.d.ts +52 -0
  47. package/dist/ui/terminal-plan.js +49 -0
  48. package/dist/ui/transcript-text.d.ts +11 -0
  49. package/dist/ui/transcript-text.js +21 -7
  50. package/dist/ui/use-startup-notices.d.ts +12 -1
  51. package/dist/ui/use-startup-notices.js +28 -2
  52. package/package.json +2 -2
  53. package/skills/project-indexer/SKILL.md +163 -163
  54. package/skills/project-indexer/templates/cleancode-overrides.md +46 -46
  55. package/skills/project-indexer/templates/cleancode-template.md +94 -94
  56. package/skills/project-indexer/templates/config-template.md +69 -69
  57. package/skills/project-indexer/templates/index-template.md +129 -129
  58. package/skills/skill-creator/SKILL.md +96 -96
@@ -1,94 +1,94 @@
1
- <!--
2
- cleancode-template.md — rendered into CLAUDE.md by project-indexer (Step 5).
3
- Authoring rules:
4
- - Chinese character body must measure 1,400–1,700 characters
5
- (matched by regex `[一-鿿]`).
6
- - Verify after editing by counting matches of `[一-鿿]` in this file.
7
- - Placeholders: {{MAX_FILE_LINES}} {{MAX_METHOD_LINES}}
8
- {{MAX_FUNCTION_PARAMS}} {{MAX_CYCLOMATIC}} {{MAX_LINE_LENGTH}}
9
- {{MAX_NESTING_DEPTH}} {{PRIMARY_LANGUAGES}} {{LANGUAGE_HINTS}}
10
- - At runtime the skill must ensure no `{{...}}` placeholder leaks into
11
- the rendered output. Numeric character counting at runtime is NOT
12
- required.
13
- -->
14
-
15
- > 本节由 `project-indexer` 自动维护,灵感取自谷歌风格,并按本项目主要语言收敛阈值。请勿手工编辑 markers 之间的内容,需要刷新时请运行「regenerate index」。
16
-
17
- ### 一、概述
18
-
19
- 本节是本项目在使用 AI 辅助开发时必须遵守的代码规范。在写或改动任何代码之前,先把下列条目读完一遍,再动键盘。规则的目的不是束缚发挥,而是让人类与 agent 写出的代码在阈值上保持可比的下限,避免出现千行文件与几百行方法,避免命名混乱、错误吞咽、测试缺失这些会在后续维护中迅速发酵的问题。所有阈值都允许根据项目实际情况调整,但调整必须在 `.claude-index/config.md` 中显式记录,并在评审中说明理由,不要靠默认值偷偷放宽。
20
-
21
- ### 二、文件与函数尺寸
22
-
23
- - 单文件不超过 **{{MAX_FILE_LINES}}** 行,超过即按职责拆分到新模块。
24
- - 单方法不超过 **{{MAX_METHOD_LINES}}** 行,写到一半感觉膨胀就先抽函数。
25
- - 函数形参不超过 **{{MAX_FUNCTION_PARAMS}}** 个,多了请改用配置对象、命名参数或聚合结构体,禁止靠位置堆参数。
26
- - 圈复杂度不超过 **{{MAX_CYCLOMATIC}}**,分支累积过多必须拆函数或引入查找表。
27
- - 单行长度不超过 **{{MAX_LINE_LENGTH}}** 列,超长就换行或抽变量名。判定标准很简单:阈值超了就是技术债,提交前自查并修正。
28
-
29
- ### 三、命名
30
-
31
- - 函数以动词开头表达动作,例如 `loadConfig`、`parseToken`;查询类用名词或 `get` / `find`。
32
- - 返回布尔值的函数与变量以 `is`、`has`、`should`、`can` 起头,便于阅读条件表达式。
33
- - 常量使用大写蛇形,模块名短小且语义化,避免堆叠首字母缩写。
34
- - 不缩写领域词,宁可名字长五个字母也要让读者一眼看懂含义。
35
- - 类与接口使用大驼峰命名,方法与变量使用小驼峰或语言推荐的蛇形写法,保持整个仓库风格一致。
36
- - 避免使用 `data`、`info`、`temp`、`obj` 这类无信息量的名字;给出具体的领域名词。
37
-
38
- ### 四、注释与文档
39
-
40
- - 注释只解释「为什么」,不复述「做什么」,代码本身就是「做什么」的真相。
41
- - 所有公开 API 必须写 docstring,标注参数、返回值与可能抛出的异常。
42
- - 删除一切僵尸注释与被注释掉的旧代码;保留 `TODO` 必须带责任人与日期。
43
- - 行级注释稀缺即珍贵,不要在每行上方堆一句无信息量的话。
44
- - 复杂业务规则、踩坑记录、临时性 workaround 必须在注释中写清楚原因与可回退条件。
45
-
46
- ### 五、错误处理
47
-
48
- - 错误显式传播,不要默默吞异常或返回 `null` 假装一切正常。
49
- - 外部输入在边界处一次性校验,进入内部后信任内部数据,禁止层层重复校验。
50
- - 不要为「理论上不会发生」的分支写防御性 `try/except`,那只是噪音。
51
- - 错误信息必须包含定位线索:发生在哪、关键参数是什么、下游应如何处理。
52
- - 在 IO、网络、子进程等不可控边界,使用带超时与重试的结构化封装,而非裸调用。
53
- - 捕获异常时尽量缩小作用域,只处理你确实有办法应对的错误类型,其他原样向上抛出。
54
- - 对外暴露的错误码或异常类必须稳定,更名等同于破坏性变更,需要在变更日志中显式标注。
55
-
56
- ### 六、复杂度与嵌套
57
-
58
- - 嵌套深度不超过 **{{MAX_NESTING_DEPTH}}** 层,深嵌套是函数过长的前兆。
59
- - 优先使用早返回(guard clause)取代 `else` 阶梯。
60
- - 单个表达式里出现超过三个布尔条件,立刻抽成命名清晰的辅助函数。
61
- - 循环里若出现复杂条件分支,改写为查找表或策略对象往往更易读。
62
- - 一个函数只做一件事;当解释函数职责时需要用「并」「同时」「再」这类连词,就是应该拆分的信号。
63
-
64
- ### 七、测试
65
-
66
- - 修 bug 必须先写一个能稳定复现该 bug 的测试用例,再动业务代码。
67
- - 公开行为都要有单元测试覆盖正常路径与至少一条异常路径。
68
- - 测试名描述被验证的行为而非实现细节,例如 `rejects_expired_token`。
69
- - 不允许 mock 数据库迁移、鉴权签名等高风险路径,必须使用真实集成测试。
70
- - 单测应快速且可重复运行;外部依赖通过桩或本地容器隔离,禁止依赖共享环境状态。
71
- - 任何被发现的回归 bug 都要补上对应的测试,把过去的坑变成未来的护栏。
72
-
73
- ### 八、代码评审清单
74
-
75
- 提交前对照以下 8 条自查,任何一条不满足即视为未完成:
76
-
77
- 1. 命名是否自解释,是否避免无意义缩写。
78
- 2. 文件、方法、参数、嵌套、圈复杂度是否都在阈值内。
79
- 3. 错误是否显式传播,边界校验是否到位。
80
- 4. 注释是否只解释「为什么」,是否还有僵尸代码或孤儿 TODO。
81
- 5. 测试是否覆盖正常路径与异常路径,是否能稳定复现已修复的 bug。
82
- 6. 是否引入新依赖,依赖是否必要、是否有安全或许可证风险。
83
- 7. 是否泄露密钥、个人数据、内部链接等敏感信息。
84
- 8. 是否与现有架构与命名风格一致,是否制造新的孤岛。
85
-
86
- ### 九、语言特有提示
87
-
88
- 当前项目主要语言:**{{PRIMARY_LANGUAGES}}**。
89
-
90
- {{LANGUAGE_HINTS}}
91
-
92
- ### 十、元信息
93
-
94
- 模板版本与上方 markers 中的版本一致。说「regenerate index」或「更新索引」可重新生成本节内容;说「disable cleancode」可移除本节。
1
+ <!--
2
+ cleancode-template.md — rendered into CLAUDE.md by project-indexer (Step 5).
3
+ Authoring rules:
4
+ - Chinese character body must measure 1,400–1,700 characters
5
+ (matched by regex `[一-鿿]`).
6
+ - Verify after editing by counting matches of `[一-鿿]` in this file.
7
+ - Placeholders: {{MAX_FILE_LINES}} {{MAX_METHOD_LINES}}
8
+ {{MAX_FUNCTION_PARAMS}} {{MAX_CYCLOMATIC}} {{MAX_LINE_LENGTH}}
9
+ {{MAX_NESTING_DEPTH}} {{PRIMARY_LANGUAGES}} {{LANGUAGE_HINTS}}
10
+ - At runtime the skill must ensure no `{{...}}` placeholder leaks into
11
+ the rendered output. Numeric character counting at runtime is NOT
12
+ required.
13
+ -->
14
+
15
+ > 本节由 `project-indexer` 自动维护,灵感取自谷歌风格,并按本项目主要语言收敛阈值。请勿手工编辑 markers 之间的内容,需要刷新时请运行「regenerate index」。
16
+
17
+ ### 一、概述
18
+
19
+ 本节是本项目在使用 AI 辅助开发时必须遵守的代码规范。在写或改动任何代码之前,先把下列条目读完一遍,再动键盘。规则的目的不是束缚发挥,而是让人类与 agent 写出的代码在阈值上保持可比的下限,避免出现千行文件与几百行方法,避免命名混乱、错误吞咽、测试缺失这些会在后续维护中迅速发酵的问题。所有阈值都允许根据项目实际情况调整,但调整必须在 `.claude-index/config.md` 中显式记录,并在评审中说明理由,不要靠默认值偷偷放宽。
20
+
21
+ ### 二、文件与函数尺寸
22
+
23
+ - 单文件不超过 **{{MAX_FILE_LINES}}** 行,超过即按职责拆分到新模块。
24
+ - 单方法不超过 **{{MAX_METHOD_LINES}}** 行,写到一半感觉膨胀就先抽函数。
25
+ - 函数形参不超过 **{{MAX_FUNCTION_PARAMS}}** 个,多了请改用配置对象、命名参数或聚合结构体,禁止靠位置堆参数。
26
+ - 圈复杂度不超过 **{{MAX_CYCLOMATIC}}**,分支累积过多必须拆函数或引入查找表。
27
+ - 单行长度不超过 **{{MAX_LINE_LENGTH}}** 列,超长就换行或抽变量名。判定标准很简单:阈值超了就是技术债,提交前自查并修正。
28
+
29
+ ### 三、命名
30
+
31
+ - 函数以动词开头表达动作,例如 `loadConfig`、`parseToken`;查询类用名词或 `get` / `find`。
32
+ - 返回布尔值的函数与变量以 `is`、`has`、`should`、`can` 起头,便于阅读条件表达式。
33
+ - 常量使用大写蛇形,模块名短小且语义化,避免堆叠首字母缩写。
34
+ - 不缩写领域词,宁可名字长五个字母也要让读者一眼看懂含义。
35
+ - 类与接口使用大驼峰命名,方法与变量使用小驼峰或语言推荐的蛇形写法,保持整个仓库风格一致。
36
+ - 避免使用 `data`、`info`、`temp`、`obj` 这类无信息量的名字;给出具体的领域名词。
37
+
38
+ ### 四、注释与文档
39
+
40
+ - 注释只解释「为什么」,不复述「做什么」,代码本身就是「做什么」的真相。
41
+ - 所有公开 API 必须写 docstring,标注参数、返回值与可能抛出的异常。
42
+ - 删除一切僵尸注释与被注释掉的旧代码;保留 `TODO` 必须带责任人与日期。
43
+ - 行级注释稀缺即珍贵,不要在每行上方堆一句无信息量的话。
44
+ - 复杂业务规则、踩坑记录、临时性 workaround 必须在注释中写清楚原因与可回退条件。
45
+
46
+ ### 五、错误处理
47
+
48
+ - 错误显式传播,不要默默吞异常或返回 `null` 假装一切正常。
49
+ - 外部输入在边界处一次性校验,进入内部后信任内部数据,禁止层层重复校验。
50
+ - 不要为「理论上不会发生」的分支写防御性 `try/except`,那只是噪音。
51
+ - 错误信息必须包含定位线索:发生在哪、关键参数是什么、下游应如何处理。
52
+ - 在 IO、网络、子进程等不可控边界,使用带超时与重试的结构化封装,而非裸调用。
53
+ - 捕获异常时尽量缩小作用域,只处理你确实有办法应对的错误类型,其他原样向上抛出。
54
+ - 对外暴露的错误码或异常类必须稳定,更名等同于破坏性变更,需要在变更日志中显式标注。
55
+
56
+ ### 六、复杂度与嵌套
57
+
58
+ - 嵌套深度不超过 **{{MAX_NESTING_DEPTH}}** 层,深嵌套是函数过长的前兆。
59
+ - 优先使用早返回(guard clause)取代 `else` 阶梯。
60
+ - 单个表达式里出现超过三个布尔条件,立刻抽成命名清晰的辅助函数。
61
+ - 循环里若出现复杂条件分支,改写为查找表或策略对象往往更易读。
62
+ - 一个函数只做一件事;当解释函数职责时需要用「并」「同时」「再」这类连词,就是应该拆分的信号。
63
+
64
+ ### 七、测试
65
+
66
+ - 修 bug 必须先写一个能稳定复现该 bug 的测试用例,再动业务代码。
67
+ - 公开行为都要有单元测试覆盖正常路径与至少一条异常路径。
68
+ - 测试名描述被验证的行为而非实现细节,例如 `rejects_expired_token`。
69
+ - 不允许 mock 数据库迁移、鉴权签名等高风险路径,必须使用真实集成测试。
70
+ - 单测应快速且可重复运行;外部依赖通过桩或本地容器隔离,禁止依赖共享环境状态。
71
+ - 任何被发现的回归 bug 都要补上对应的测试,把过去的坑变成未来的护栏。
72
+
73
+ ### 八、代码评审清单
74
+
75
+ 提交前对照以下 8 条自查,任何一条不满足即视为未完成:
76
+
77
+ 1. 命名是否自解释,是否避免无意义缩写。
78
+ 2. 文件、方法、参数、嵌套、圈复杂度是否都在阈值内。
79
+ 3. 错误是否显式传播,边界校验是否到位。
80
+ 4. 注释是否只解释「为什么」,是否还有僵尸代码或孤儿 TODO。
81
+ 5. 测试是否覆盖正常路径与异常路径,是否能稳定复现已修复的 bug。
82
+ 6. 是否引入新依赖,依赖是否必要、是否有安全或许可证风险。
83
+ 7. 是否泄露密钥、个人数据、内部链接等敏感信息。
84
+ 8. 是否与现有架构与命名风格一致,是否制造新的孤岛。
85
+
86
+ ### 九、语言特有提示
87
+
88
+ 当前项目主要语言:**{{PRIMARY_LANGUAGES}}**。
89
+
90
+ {{LANGUAGE_HINTS}}
91
+
92
+ ### 十、元信息
93
+
94
+ 模板版本与上方 markers 中的版本一致。说「regenerate index」或「更新索引」可重新生成本节内容;说「disable cleancode」可移除本节。
@@ -1,69 +1,69 @@
1
- # Index Configuration
2
-
3
- > Configuration for project-indexer. Edit this file to customize index generation.
4
-
5
- ## Excluded Directories
6
-
7
- Directories to skip during indexing:
8
-
9
- - node_modules
10
- - .git
11
- - dist
12
- - build
13
- - __pycache__
14
- - .venv
15
- - venv
16
- - vendor
17
- - coverage
18
- - .next
19
- - .nuxt
20
- - .cache
21
- - target
22
- - bin
23
- - obj
24
- - .idea
25
- - .vscode
26
-
27
- ## Priority Directories
28
-
29
- Directories to index in detail (leave empty for auto-detection):
30
-
31
- - src/
32
- - lib/
33
- - app/
34
- - core/
35
-
36
- ## Tech Stack
37
-
38
- Detected or specified technology stack:
39
-
40
- - **Frontend:** {React | Vue | Angular | Svelte | Next.js | Nuxt | etc.}
41
- - **Backend:** {Express | FastAPI | Django | Rails | Spring | etc.}
42
- - **Language:** {TypeScript | JavaScript | Python | Go | etc.}
43
-
44
- ## Index Settings
45
-
46
- - **Generated:** {YYYY-MM-DD HH:MM:SS}
47
- - **Project Root:** {/path/to/project}
48
- - **Index Version:** 1.0
49
- - **Total Files Indexed:** {N}
50
- - **Total Symbols Extracted:** {N}
51
-
52
- ## Clean Code Settings
53
-
54
- - Enabled: {Yes | No}
55
- - Preset: {strict | relaxed | custom | disabled}
56
- - MAX_FILE_LINES: 1000
57
- - MAX_METHOD_LINES: 60
58
- - MAX_FUNCTION_PARAMS: 5
59
- - MAX_CYCLOMATIC: 10
60
- - MAX_LINE_LENGTH: 100
61
- - MAX_NESTING_DEPTH: 4
62
-
63
- ## Regeneration Notes
64
-
65
- Notes for future regeneration:
66
-
67
- - {Any special considerations}
68
- - {Files that need manual review}
69
- - {Known limitations}
1
+ # Index Configuration
2
+
3
+ > Configuration for project-indexer. Edit this file to customize index generation.
4
+
5
+ ## Excluded Directories
6
+
7
+ Directories to skip during indexing:
8
+
9
+ - node_modules
10
+ - .git
11
+ - dist
12
+ - build
13
+ - __pycache__
14
+ - .venv
15
+ - venv
16
+ - vendor
17
+ - coverage
18
+ - .next
19
+ - .nuxt
20
+ - .cache
21
+ - target
22
+ - bin
23
+ - obj
24
+ - .idea
25
+ - .vscode
26
+
27
+ ## Priority Directories
28
+
29
+ Directories to index in detail (leave empty for auto-detection):
30
+
31
+ - src/
32
+ - lib/
33
+ - app/
34
+ - core/
35
+
36
+ ## Tech Stack
37
+
38
+ Detected or specified technology stack:
39
+
40
+ - **Frontend:** {React | Vue | Angular | Svelte | Next.js | Nuxt | etc.}
41
+ - **Backend:** {Express | FastAPI | Django | Rails | Spring | etc.}
42
+ - **Language:** {TypeScript | JavaScript | Python | Go | etc.}
43
+
44
+ ## Index Settings
45
+
46
+ - **Generated:** {YYYY-MM-DD HH:MM:SS}
47
+ - **Project Root:** {/path/to/project}
48
+ - **Index Version:** 1.0
49
+ - **Total Files Indexed:** {N}
50
+ - **Total Symbols Extracted:** {N}
51
+
52
+ ## Clean Code Settings
53
+
54
+ - Enabled: {Yes | No}
55
+ - Preset: {strict | relaxed | custom | disabled}
56
+ - MAX_FILE_LINES: 1000
57
+ - MAX_METHOD_LINES: 60
58
+ - MAX_FUNCTION_PARAMS: 5
59
+ - MAX_CYCLOMATIC: 10
60
+ - MAX_LINE_LENGTH: 100
61
+ - MAX_NESTING_DEPTH: 4
62
+
63
+ ## Regeneration Notes
64
+
65
+ Notes for future regeneration:
66
+
67
+ - {Any special considerations}
68
+ - {Files that need manual review}
69
+ - {Known limitations}
@@ -1,129 +1,129 @@
1
- # Project Index: {project-name}
2
-
3
- > Auto-generated by project-indexer | Last updated: {YYYY-MM-DD}
4
-
5
- ## Project Overview
6
-
7
- - **Type:** {Frontend | Backend | Fullstack | Library | CLI | Monorepo}
8
- - **Languages:** {TypeScript (70%), Python (30%)}
9
- - **Frameworks:** {Next.js, FastAPI, etc.}
10
- - **Entry Points:** `{src/index.ts}`, `{api/main.py}`
11
-
12
- ---
13
-
14
- ## Feature Map
15
-
16
- ### {Feature Name} (`{path}/`)
17
-
18
- Entry: `{entry-file}`
19
-
20
- {One-line description of this feature area}
21
-
22
- **Key exports:**
23
- - `{functionName}({params}): {returnType}` - {description}
24
- - `{ClassName}` - {description}
25
- - `{CONSTANT_NAME}` - {description}
26
-
27
- ---
28
-
29
- ### Example: Authentication (`src/auth/`)
30
-
31
- Entry: `src/auth/index.ts`
32
-
33
- User authentication, session management, and authorization logic.
34
-
35
- **Key exports:**
36
- - `login(credentials: LoginInput): Promise<User>` - Authenticate user with email/password
37
- - `logout(): void` - Clear session and revoke tokens
38
- - `useAuth(): AuthContext` - React hook for accessing auth state
39
- - `withAuth(Component): Component` - HOC for protected routes
40
- - `AuthProvider` - Context provider for auth state
41
-
42
- ---
43
-
44
- ### Example: API Layer (`src/api/`)
45
-
46
- Entry: `src/api/client.ts`
47
-
48
- REST API client with error handling, request interceptors, and response caching.
49
-
50
- **Key exports:**
51
- - `apiClient` - Pre-configured axios instance
52
- - `useQuery<T>(endpoint: string): SWRResponse<T>` - Data fetching hook with caching
53
- - `useMutation<T>(endpoint: string): MutationResult<T>` - Data mutation hook
54
- - `ApiError` - Custom error class for API errors
55
-
56
- ---
57
-
58
- ## Module Dependencies
59
-
60
- ```
61
- {module-a} → {module-b} ({relationship description})
62
- ```
63
-
64
- Example:
65
- ```
66
- auth → api (uses apiClient for authentication requests)
67
- pages → auth, components (imports hooks and UI components)
68
- api → (standalone, no internal dependencies)
69
- components → utils (uses helper functions)
70
- hooks → api, auth (combines data fetching with auth state)
71
- ```
72
-
73
- ---
74
-
75
- ## File Index
76
-
77
- ### {directory}/
78
-
79
- | File | Description |
80
- |------|-------------|
81
- | {filename.ext} | {One-line description} |
82
-
83
- ---
84
-
85
- ### Example: src/auth/
86
-
87
- | File | Description |
88
- |------|-------------|
89
- | index.ts | Module entry point, re-exports public API |
90
- | login.ts | Login logic, credential validation, token handling |
91
- | logout.ts | Logout logic, session cleanup, token revocation |
92
- | session.ts | Session storage, refresh token management |
93
- | hooks.ts | React hooks: useAuth, useUser, usePermissions |
94
- | context.tsx | AuthContext and AuthProvider implementation |
95
- | types.ts | TypeScript types for auth entities |
96
- | constants.ts | Auth-related constants and configuration |
97
-
98
- ### Example: src/api/
99
-
100
- | File | Description |
101
- |------|-------------|
102
- | client.ts | Axios instance with interceptors and base config |
103
- | endpoints.ts | API endpoint path constants |
104
- | types.ts | Request/response type definitions |
105
- | errors.ts | Custom error classes and error handling utilities |
106
- | hooks.ts | Data fetching hooks: useQuery, useMutation |
107
- | cache.ts | Response caching configuration |
108
-
109
- ### Example: src/components/
110
-
111
- | File | Description |
112
- |------|-------------|
113
- | Button.tsx | Reusable button with variants (primary, secondary, ghost) |
114
- | Modal.tsx | Dialog component with portal and focus trap |
115
- | Toast.tsx | Notification toast with auto-dismiss |
116
- | Spinner.tsx | Loading spinner component |
117
- | Form/index.tsx | Form wrapper with validation context |
118
- | Form/Input.tsx | Text input with label and error display |
119
- | Form/Select.tsx | Dropdown select component |
120
- | Form/Checkbox.tsx | Checkbox with label |
121
- | Layout/Header.tsx | App header with navigation |
122
- | Layout/Sidebar.tsx | Collapsible sidebar navigation |
123
- | Layout/Footer.tsx | App footer |
124
-
125
- ---
126
-
127
- ## Notes
128
-
129
- {Any additional notes about the project structure, conventions, or important information}
1
+ # Project Index: {project-name}
2
+
3
+ > Auto-generated by project-indexer | Last updated: {YYYY-MM-DD}
4
+
5
+ ## Project Overview
6
+
7
+ - **Type:** {Frontend | Backend | Fullstack | Library | CLI | Monorepo}
8
+ - **Languages:** {TypeScript (70%), Python (30%)}
9
+ - **Frameworks:** {Next.js, FastAPI, etc.}
10
+ - **Entry Points:** `{src/index.ts}`, `{api/main.py}`
11
+
12
+ ---
13
+
14
+ ## Feature Map
15
+
16
+ ### {Feature Name} (`{path}/`)
17
+
18
+ Entry: `{entry-file}`
19
+
20
+ {One-line description of this feature area}
21
+
22
+ **Key exports:**
23
+ - `{functionName}({params}): {returnType}` - {description}
24
+ - `{ClassName}` - {description}
25
+ - `{CONSTANT_NAME}` - {description}
26
+
27
+ ---
28
+
29
+ ### Example: Authentication (`src/auth/`)
30
+
31
+ Entry: `src/auth/index.ts`
32
+
33
+ User authentication, session management, and authorization logic.
34
+
35
+ **Key exports:**
36
+ - `login(credentials: LoginInput): Promise<User>` - Authenticate user with email/password
37
+ - `logout(): void` - Clear session and revoke tokens
38
+ - `useAuth(): AuthContext` - React hook for accessing auth state
39
+ - `withAuth(Component): Component` - HOC for protected routes
40
+ - `AuthProvider` - Context provider for auth state
41
+
42
+ ---
43
+
44
+ ### Example: API Layer (`src/api/`)
45
+
46
+ Entry: `src/api/client.ts`
47
+
48
+ REST API client with error handling, request interceptors, and response caching.
49
+
50
+ **Key exports:**
51
+ - `apiClient` - Pre-configured axios instance
52
+ - `useQuery<T>(endpoint: string): SWRResponse<T>` - Data fetching hook with caching
53
+ - `useMutation<T>(endpoint: string): MutationResult<T>` - Data mutation hook
54
+ - `ApiError` - Custom error class for API errors
55
+
56
+ ---
57
+
58
+ ## Module Dependencies
59
+
60
+ ```
61
+ {module-a} → {module-b} ({relationship description})
62
+ ```
63
+
64
+ Example:
65
+ ```
66
+ auth → api (uses apiClient for authentication requests)
67
+ pages → auth, components (imports hooks and UI components)
68
+ api → (standalone, no internal dependencies)
69
+ components → utils (uses helper functions)
70
+ hooks → api, auth (combines data fetching with auth state)
71
+ ```
72
+
73
+ ---
74
+
75
+ ## File Index
76
+
77
+ ### {directory}/
78
+
79
+ | File | Description |
80
+ |------|-------------|
81
+ | {filename.ext} | {One-line description} |
82
+
83
+ ---
84
+
85
+ ### Example: src/auth/
86
+
87
+ | File | Description |
88
+ |------|-------------|
89
+ | index.ts | Module entry point, re-exports public API |
90
+ | login.ts | Login logic, credential validation, token handling |
91
+ | logout.ts | Logout logic, session cleanup, token revocation |
92
+ | session.ts | Session storage, refresh token management |
93
+ | hooks.ts | React hooks: useAuth, useUser, usePermissions |
94
+ | context.tsx | AuthContext and AuthProvider implementation |
95
+ | types.ts | TypeScript types for auth entities |
96
+ | constants.ts | Auth-related constants and configuration |
97
+
98
+ ### Example: src/api/
99
+
100
+ | File | Description |
101
+ |------|-------------|
102
+ | client.ts | Axios instance with interceptors and base config |
103
+ | endpoints.ts | API endpoint path constants |
104
+ | types.ts | Request/response type definitions |
105
+ | errors.ts | Custom error classes and error handling utilities |
106
+ | hooks.ts | Data fetching hooks: useQuery, useMutation |
107
+ | cache.ts | Response caching configuration |
108
+
109
+ ### Example: src/components/
110
+
111
+ | File | Description |
112
+ |------|-------------|
113
+ | Button.tsx | Reusable button with variants (primary, secondary, ghost) |
114
+ | Modal.tsx | Dialog component with portal and focus trap |
115
+ | Toast.tsx | Notification toast with auto-dismiss |
116
+ | Spinner.tsx | Loading spinner component |
117
+ | Form/index.tsx | Form wrapper with validation context |
118
+ | Form/Input.tsx | Text input with label and error display |
119
+ | Form/Select.tsx | Dropdown select component |
120
+ | Form/Checkbox.tsx | Checkbox with label |
121
+ | Layout/Header.tsx | App header with navigation |
122
+ | Layout/Sidebar.tsx | Collapsible sidebar navigation |
123
+ | Layout/Footer.tsx | App footer |
124
+
125
+ ---
126
+
127
+ ## Notes
128
+
129
+ {Any additional notes about the project structure, conventions, or important information}