aiwcli 0.10.2 → 0.11.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.
- package/bin/run.js +1 -1
- package/dist/commands/clear.d.ts +11 -6
- package/dist/commands/clear.js +229 -381
- package/dist/commands/init/index.d.ts +1 -17
- package/dist/commands/init/index.js +22 -107
- package/dist/lib/gitignore-manager.d.ts +32 -0
- package/dist/lib/gitignore-manager.js +141 -2
- package/dist/lib/template-installer.d.ts +7 -12
- package/dist/lib/template-installer.js +69 -193
- package/dist/lib/template-settings-reconstructor.d.ts +35 -0
- package/dist/lib/template-settings-reconstructor.js +130 -0
- package/dist/templates/CLAUDE.md +8 -8
- package/dist/templates/_shared/.claude/commands/handoff-resume.md +64 -0
- package/dist/templates/_shared/.claude/commands/handoff.md +16 -10
- package/dist/templates/_shared/.claude/settings.json +7 -7
- package/dist/templates/_shared/hooks-ts/_utils/git-state.ts +2 -0
- package/dist/templates/_shared/hooks-ts/archive_plan.ts +159 -0
- package/dist/templates/_shared/hooks-ts/context_monitor.ts +147 -0
- package/dist/templates/_shared/hooks-ts/file-suggestion.ts +130 -0
- package/dist/templates/_shared/hooks-ts/pre_compact.ts +49 -0
- package/dist/templates/_shared/hooks-ts/session_end.ts +104 -0
- package/dist/templates/_shared/hooks-ts/session_start.ts +144 -0
- package/dist/templates/_shared/hooks-ts/task_create_capture.ts +48 -0
- package/dist/templates/_shared/hooks-ts/task_update_capture.ts +74 -0
- package/dist/templates/_shared/hooks-ts/user_prompt_submit.ts +83 -0
- package/dist/templates/_shared/lib-ts/CLAUDE.md +318 -0
- package/dist/templates/_shared/lib-ts/base/atomic-write.ts +138 -0
- package/dist/templates/_shared/lib-ts/base/constants.ts +306 -0
- package/dist/templates/_shared/lib-ts/base/git-state.ts +58 -0
- package/dist/templates/_shared/lib-ts/base/hook-utils.ts +439 -0
- package/dist/templates/_shared/lib-ts/base/inference.ts +252 -0
- package/dist/templates/_shared/lib-ts/base/logger.ts +250 -0
- package/dist/templates/_shared/lib-ts/base/state-io.ts +116 -0
- package/dist/templates/_shared/lib-ts/base/stop-words.ts +184 -0
- package/dist/templates/_shared/lib-ts/base/subprocess-utils.ts +162 -0
- package/dist/templates/_shared/lib-ts/base/utils.ts +184 -0
- package/dist/templates/_shared/lib-ts/context/context-formatter.ts +438 -0
- package/dist/templates/_shared/lib-ts/context/context-selector.ts +515 -0
- package/dist/templates/_shared/lib-ts/context/context-store.ts +707 -0
- package/dist/templates/_shared/lib-ts/context/plan-manager.ts +316 -0
- package/dist/templates/_shared/lib-ts/context/task-tracker.ts +185 -0
- package/dist/templates/_shared/lib-ts/handoff/document-generator.ts +216 -0
- package/dist/templates/_shared/lib-ts/handoff/handoff-reader.ts +159 -0
- package/dist/templates/_shared/lib-ts/package.json +21 -0
- package/dist/templates/_shared/lib-ts/templates/formatters.ts +104 -0
- package/dist/templates/_shared/{lib/templates/plan_context.py → lib-ts/templates/plan-context.ts} +14 -22
- package/dist/templates/_shared/lib-ts/tsconfig.json +13 -0
- package/dist/templates/_shared/lib-ts/types.ts +164 -0
- package/dist/templates/_shared/scripts/resolve_context.ts +24 -0
- package/dist/templates/_shared/scripts/resume_handoff.ts +321 -0
- package/dist/templates/_shared/scripts/save_handoff.ts +359 -0
- package/dist/templates/_shared/scripts/status_line.ts +733 -0
- package/dist/templates/cc-native/.claude/settings.json +175 -185
- package/dist/templates/cc-native/TEMPLATE-SCHEMA.md +15 -17
- package/dist/templates/cc-native/_cc-native/agents/ARCH-EVOLUTION.md +63 -0
- package/dist/templates/cc-native/_cc-native/agents/ARCH-PATTERNS.md +62 -0
- package/dist/templates/cc-native/_cc-native/agents/ARCH-STRUCTURE.md +63 -0
- package/dist/templates/cc-native/_cc-native/agents/{ASSUMPTION-CHAIN-TRACER.md → ASSUMPTION-TRACER.md} +6 -10
- package/dist/templates/cc-native/_cc-native/agents/CLARITY-AUDITOR.md +6 -10
- package/dist/templates/cc-native/_cc-native/agents/CLAUDE.md +74 -3
- package/dist/templates/cc-native/_cc-native/agents/COMPLETENESS-FEASIBILITY.md +67 -0
- package/dist/templates/cc-native/_cc-native/agents/COMPLETENESS-GAPS.md +71 -0
- package/dist/templates/cc-native/_cc-native/agents/COMPLETENESS-ORDERING.md +63 -0
- package/dist/templates/cc-native/_cc-native/agents/CONSTRAINT-VALIDATOR.md +73 -0
- package/dist/templates/cc-native/_cc-native/agents/DESIGN-ADR-VALIDATOR.md +62 -0
- package/dist/templates/cc-native/_cc-native/agents/DESIGN-SCALE-MATCHER.md +65 -0
- package/dist/templates/cc-native/_cc-native/agents/DEVILS-ADVOCATE.md +6 -9
- package/dist/templates/cc-native/_cc-native/agents/DOCUMENTATION-PHILOSOPHY.md +87 -0
- package/dist/templates/cc-native/_cc-native/agents/HANDOFF-READINESS.md +5 -9
- package/dist/templates/cc-native/_cc-native/agents/{HIDDEN-COMPLEXITY-DETECTOR.md → HIDDEN-COMPLEXITY.md} +6 -10
- package/dist/templates/cc-native/_cc-native/agents/INCREMENTAL-DELIVERY.md +67 -0
- package/dist/templates/cc-native/_cc-native/agents/PLAN-ORCHESTRATOR.md +91 -18
- package/dist/templates/cc-native/_cc-native/agents/RISK-DEPENDENCY.md +63 -0
- package/dist/templates/cc-native/_cc-native/agents/RISK-FMEA.md +67 -0
- package/dist/templates/cc-native/_cc-native/agents/RISK-PREMORTEM.md +72 -0
- package/dist/templates/cc-native/_cc-native/agents/RISK-REVERSIBILITY.md +75 -0
- package/dist/templates/cc-native/_cc-native/agents/SCOPE-BOUNDARY.md +78 -0
- package/dist/templates/cc-native/_cc-native/agents/SIMPLICITY-GUARDIAN.md +5 -9
- package/dist/templates/cc-native/_cc-native/agents/SKEPTIC.md +16 -12
- package/dist/templates/cc-native/_cc-native/agents/TESTDRIVEN-BEHAVIOR-AUDITOR.md +62 -0
- package/dist/templates/cc-native/_cc-native/agents/TESTDRIVEN-CHARACTERIZATION.md +72 -0
- package/dist/templates/cc-native/_cc-native/agents/TESTDRIVEN-FIRST-VALIDATOR.md +62 -0
- package/dist/templates/cc-native/_cc-native/agents/TESTDRIVEN-PYRAMID-ANALYZER.md +62 -0
- package/dist/templates/cc-native/_cc-native/agents/TRADEOFF-COSTS.md +68 -0
- package/dist/templates/cc-native/_cc-native/agents/TRADEOFF-STAKEHOLDERS.md +66 -0
- package/dist/templates/cc-native/_cc-native/agents/VERIFY-COVERAGE.md +75 -0
- package/dist/templates/cc-native/_cc-native/agents/VERIFY-STRENGTH.md +70 -0
- package/dist/templates/cc-native/_cc-native/hooks/CLAUDE.md +109 -135
- package/dist/templates/cc-native/_cc-native/hooks/add_plan_context.ts +119 -0
- package/dist/templates/cc-native/_cc-native/hooks/cc-native-plan-review.ts +921 -0
- package/dist/templates/cc-native/_cc-native/hooks/plan_questions_early.ts +61 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/aggregate-agents.ts +157 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/artifacts.ts +709 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/cc-native-state.ts +199 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/cli-output-parser.ts +124 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/config.ts +57 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/constants.ts +83 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/debug.ts +80 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/index.ts +119 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/json-parser.ts +162 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/nul +3 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/orchestrator.ts +249 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/agent.ts +155 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/codex.ts +130 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/gemini.ts +106 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/index.ts +10 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/types.ts +23 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/state.ts +243 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/tsconfig.json +18 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/types.ts +310 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/verdict.ts +72 -0
- package/dist/templates/cc-native/_cc-native/plan-review.config.json +12 -16
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/dist/lib/template-merger.d.ts +0 -47
- package/dist/lib/template-merger.js +0 -162
- package/dist/templates/_shared/hooks/__init__.py +0 -16
- package/dist/templates/_shared/hooks/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/archive_plan.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/context_enforcer.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/context_monitor.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/file-suggestion.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/pre_compact.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/session_end.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/session_start.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/task_create_atomicity.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/task_create_capture.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/task_update_capture.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/user_prompt_submit.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/archive_plan.py +0 -169
- package/dist/templates/_shared/hooks/context_monitor.py +0 -270
- package/dist/templates/_shared/hooks/file-suggestion.py +0 -215
- package/dist/templates/_shared/hooks/pre_compact.py +0 -104
- package/dist/templates/_shared/hooks/session_end.py +0 -173
- package/dist/templates/_shared/hooks/session_start.py +0 -206
- package/dist/templates/_shared/hooks/task_create_capture.py +0 -108
- package/dist/templates/_shared/hooks/task_update_capture.py +0 -145
- package/dist/templates/_shared/hooks/user_prompt_submit.py +0 -139
- package/dist/templates/_shared/lib/__init__.py +0 -1
- package/dist/templates/_shared/lib/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/base/__init__.py +0 -65
- package/dist/templates/_shared/lib/base/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/base/__pycache__/atomic_write.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/base/__pycache__/constants.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/base/__pycache__/hook_utils.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/base/__pycache__/inference.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/base/__pycache__/logger.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/base/__pycache__/stop_words.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/base/__pycache__/subprocess_utils.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/base/__pycache__/utils.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/base/atomic_write.py +0 -180
- package/dist/templates/_shared/lib/base/constants.py +0 -358
- package/dist/templates/_shared/lib/base/hook_utils.py +0 -341
- package/dist/templates/_shared/lib/base/inference.py +0 -318
- package/dist/templates/_shared/lib/base/logger.py +0 -291
- package/dist/templates/_shared/lib/base/stop_words.py +0 -213
- package/dist/templates/_shared/lib/base/subprocess_utils.py +0 -46
- package/dist/templates/_shared/lib/base/utils.py +0 -242
- package/dist/templates/_shared/lib/context/__init__.py +0 -102
- package/dist/templates/_shared/lib/context/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/__pycache__/cache.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/__pycache__/context_extractor.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/__pycache__/context_formatter.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/__pycache__/context_manager.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/__pycache__/context_selector.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/__pycache__/context_store.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/__pycache__/discovery.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/__pycache__/event_log.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/__pycache__/plan_archive.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/__pycache__/plan_manager.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/__pycache__/task_sync.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/__pycache__/task_tracker.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/context_formatter.py +0 -317
- package/dist/templates/_shared/lib/context/context_selector.py +0 -508
- package/dist/templates/_shared/lib/context/context_store.py +0 -653
- package/dist/templates/_shared/lib/context/plan_manager.py +0 -204
- package/dist/templates/_shared/lib/context/task_tracker.py +0 -188
- package/dist/templates/_shared/lib/handoff/__init__.py +0 -22
- package/dist/templates/_shared/lib/handoff/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/handoff/__pycache__/document_generator.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/handoff/document_generator.py +0 -278
- package/dist/templates/_shared/lib/templates/README.md +0 -206
- package/dist/templates/_shared/lib/templates/__init__.py +0 -36
- package/dist/templates/_shared/lib/templates/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/templates/__pycache__/formatters.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/templates/__pycache__/persona_questions.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/templates/__pycache__/plan_context.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/templates/formatters.py +0 -146
- package/dist/templates/_shared/scripts/__pycache__/save_handoff.cpython-313.pyc +0 -0
- package/dist/templates/_shared/scripts/__pycache__/status_line.cpython-313.pyc +0 -0
- package/dist/templates/_shared/scripts/save_handoff.py +0 -357
- package/dist/templates/_shared/scripts/status_line.py +0 -701
- package/dist/templates/cc-native/.claude/commands/cc-native/fresh-perspective.md +0 -8
- package/dist/templates/cc-native/.windsurf/workflows/cc-native/fresh-perspective.md +0 -8
- package/dist/templates/cc-native/MIGRATION.md +0 -86
- package/dist/templates/cc-native/_cc-native/agents/ACCESSIBILITY-TESTER.md +0 -79
- package/dist/templates/cc-native/_cc-native/agents/ARCHITECT-REVIEWER.md +0 -48
- package/dist/templates/cc-native/_cc-native/agents/CODE-REVIEWER.md +0 -70
- package/dist/templates/cc-native/_cc-native/agents/COMPLETENESS-CHECKER.md +0 -59
- package/dist/templates/cc-native/_cc-native/agents/CONTEXT-EXTRACTOR.md +0 -92
- package/dist/templates/cc-native/_cc-native/agents/DOCUMENTATION-REVIEWER.md +0 -51
- package/dist/templates/cc-native/_cc-native/agents/FEASIBILITY-ANALYST.md +0 -57
- package/dist/templates/cc-native/_cc-native/agents/FRESH-PERSPECTIVE.md +0 -54
- package/dist/templates/cc-native/_cc-native/agents/INCENTIVE-MAPPER.md +0 -61
- package/dist/templates/cc-native/_cc-native/agents/PENETRATION-TESTER.md +0 -79
- package/dist/templates/cc-native/_cc-native/agents/PERFORMANCE-ENGINEER.md +0 -75
- package/dist/templates/cc-native/_cc-native/agents/PRECEDENT-FINDER.md +0 -70
- package/dist/templates/cc-native/_cc-native/agents/REVERSIBILITY-ANALYST.md +0 -61
- package/dist/templates/cc-native/_cc-native/agents/RISK-ASSESSOR.md +0 -58
- package/dist/templates/cc-native/_cc-native/agents/SECOND-ORDER-ANALYST.md +0 -61
- package/dist/templates/cc-native/_cc-native/agents/STAKEHOLDER-ADVOCATE.md +0 -55
- package/dist/templates/cc-native/_cc-native/agents/TRADE-OFF-ILLUMINATOR.md +0 -204
- package/dist/templates/cc-native/_cc-native/hooks/__pycache__/add_plan_context.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/hooks/__pycache__/cc-native-plan-review.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/hooks/__pycache__/mark_questions_asked.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/hooks/__pycache__/plan_accepted.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/hooks/__pycache__/plan_questions_early.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/hooks/__pycache__/suggest-fresh-perspective.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/hooks/add_plan_context.py +0 -130
- package/dist/templates/cc-native/_cc-native/hooks/cc-native-plan-review.py +0 -869
- package/dist/templates/cc-native/_cc-native/hooks/plan_questions_early.py +0 -81
- package/dist/templates/cc-native/_cc-native/hooks/suggest-fresh-perspective.py +0 -340
- package/dist/templates/cc-native/_cc-native/lib/CLAUDE.md +0 -265
- package/dist/templates/cc-native/_cc-native/lib/__init__.py +0 -53
- package/dist/templates/cc-native/_cc-native/lib/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/lib/__pycache__/atomic_write.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/lib/__pycache__/constants.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/lib/__pycache__/debug.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/lib/__pycache__/orchestrator.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/lib/__pycache__/state.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/lib/__pycache__/utils.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/lib/constants.py +0 -45
- package/dist/templates/cc-native/_cc-native/lib/debug.py +0 -139
- package/dist/templates/cc-native/_cc-native/lib/orchestrator.py +0 -362
- package/dist/templates/cc-native/_cc-native/lib/reviewers/__init__.py +0 -28
- package/dist/templates/cc-native/_cc-native/lib/reviewers/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/lib/reviewers/__pycache__/agent.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/lib/reviewers/__pycache__/base.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/lib/reviewers/__pycache__/codex.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/lib/reviewers/__pycache__/gemini.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/lib/reviewers/agent.py +0 -215
- package/dist/templates/cc-native/_cc-native/lib/reviewers/base.py +0 -88
- package/dist/templates/cc-native/_cc-native/lib/reviewers/codex.py +0 -124
- package/dist/templates/cc-native/_cc-native/lib/reviewers/gemini.py +0 -108
- package/dist/templates/cc-native/_cc-native/lib/state.py +0 -268
- package/dist/templates/cc-native/_cc-native/lib/utils.py +0 -1027
- package/dist/templates/cc-native/_cc-native/scripts/__pycache__/aggregate_agents.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/scripts/aggregate_agents.py +0 -168
- package/dist/templates/cc-native/_cc-native/workflows/fresh-perspective.md +0 -134
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
# Shared Templates Module
|
|
2
|
-
|
|
3
|
-
Centralized templates and formatters for consistent context management output across context formatting, handoff, and hooks.
|
|
4
|
-
|
|
5
|
-
## Purpose
|
|
6
|
-
|
|
7
|
-
This module eliminates duplication by providing a single source of truth for:
|
|
8
|
-
- Mode displays (planning, implementing, etc.)
|
|
9
|
-
- Status icons (pending, in_progress, completed)
|
|
10
|
-
- Task rendering formatters
|
|
11
|
-
- Context continuation headers
|
|
12
|
-
- Plan context templates
|
|
13
|
-
- Handoff reason formatting
|
|
14
|
-
|
|
15
|
-
## Modules
|
|
16
|
-
|
|
17
|
-
### `formatters.py`
|
|
18
|
-
|
|
19
|
-
Core formatters and constants for context management output.
|
|
20
|
-
|
|
21
|
-
#### Constants
|
|
22
|
-
|
|
23
|
-
```python
|
|
24
|
-
MODE_DISPLAY_MAP = {
|
|
25
|
-
"planning": "[Planning]",
|
|
26
|
-
"pending_implementation": "[Plan Ready]",
|
|
27
|
-
"implementing": "[Implementing]",
|
|
28
|
-
"none": "",
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
STATUS_ICON_MAP = {
|
|
32
|
-
"pending": "⬜",
|
|
33
|
-
"in_progress": "🔄",
|
|
34
|
-
"blocked": "🚫",
|
|
35
|
-
"completed": "✅",
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
REASON_MAP = {
|
|
39
|
-
"low_context": "Context window running low",
|
|
40
|
-
"user_requested": "User requested handoff",
|
|
41
|
-
"error_recovery": "Error recovery",
|
|
42
|
-
"session_end": "Session ending",
|
|
43
|
-
}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
#### Functions
|
|
47
|
-
|
|
48
|
-
**`get_mode_display(mode: str) -> str`**
|
|
49
|
-
|
|
50
|
-
Get display string for in-flight mode.
|
|
51
|
-
|
|
52
|
-
```python
|
|
53
|
-
>>> get_mode_display("planning")
|
|
54
|
-
"[Planning]"
|
|
55
|
-
>>> get_mode_display("none")
|
|
56
|
-
""
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
**`get_status_icon(status: str) -> str`**
|
|
60
|
-
|
|
61
|
-
Get emoji icon for task status.
|
|
62
|
-
|
|
63
|
-
```python
|
|
64
|
-
>>> get_status_icon("pending")
|
|
65
|
-
"⬜"
|
|
66
|
-
>>> get_status_icon("completed")
|
|
67
|
-
"✅"
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
**`render_task_item(task, show_description=True, max_description_length=100) -> str`**
|
|
71
|
-
|
|
72
|
-
Render single task with status icon and subject.
|
|
73
|
-
|
|
74
|
-
```python
|
|
75
|
-
task = {"status": "pending", "subject": "Fix bug", "description": "Details"}
|
|
76
|
-
>>> render_task_item(task)
|
|
77
|
-
"- ⬜ [PENDING] Fix bug\n - Details"
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
**`render_task_list(tasks, header="Active Tasks", show_description=True) -> str`**
|
|
81
|
-
|
|
82
|
-
Render list of tasks with header.
|
|
83
|
-
|
|
84
|
-
```python
|
|
85
|
-
tasks = [{"status": "pending", "subject": "Task 1", "description": "Details"}]
|
|
86
|
-
>>> render_task_list(tasks, header="My Tasks")
|
|
87
|
-
"### My Tasks\n\n- ⬜ [PENDING] Task 1\n - Details\n"
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
**`format_continuation_header(header_type: str, context_id: str) -> str`**
|
|
91
|
-
|
|
92
|
-
Format continuation header for various scenarios.
|
|
93
|
-
|
|
94
|
-
```python
|
|
95
|
-
>>> format_continuation_header("resuming", "my-context")
|
|
96
|
-
"## RESUMING FROM HANDOFF: my-context"
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
Types: `context`, `resuming`, `implementing`, `handoff`
|
|
100
|
-
|
|
101
|
-
**`format_reason(reason: str) -> str`**
|
|
102
|
-
|
|
103
|
-
Format handoff reason code as human-readable string.
|
|
104
|
-
|
|
105
|
-
```python
|
|
106
|
-
>>> format_reason("low_context")
|
|
107
|
-
"Context window running low"
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### `plan_context.py`
|
|
111
|
-
|
|
112
|
-
Plan context templates for the add_plan_context hook.
|
|
113
|
-
|
|
114
|
-
**`get_evaluation_context_reminder() -> str`**
|
|
115
|
-
|
|
116
|
-
Returns the evaluation context reminder template that prompts Claude to add evaluation context to plans.
|
|
117
|
-
|
|
118
|
-
## Usage
|
|
119
|
-
|
|
120
|
-
### In Discovery Functions
|
|
121
|
-
|
|
122
|
-
```python
|
|
123
|
-
from ..templates.formatters import (
|
|
124
|
-
get_mode_display,
|
|
125
|
-
get_status_icon,
|
|
126
|
-
format_continuation_header,
|
|
127
|
-
)
|
|
128
|
-
|
|
129
|
-
# Display mode status
|
|
130
|
-
mode_display = get_mode_display(context.in_flight.mode)
|
|
131
|
-
status = f"Context: {context.id} {mode_display}"
|
|
132
|
-
|
|
133
|
-
# Render task with icon
|
|
134
|
-
icon = get_status_icon(task.status)
|
|
135
|
-
output = f"{icon} {task.subject}"
|
|
136
|
-
|
|
137
|
-
# Create continuation header
|
|
138
|
-
header = format_continuation_header("implementing", context.id)
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### In Document Generator
|
|
142
|
-
|
|
143
|
-
```python
|
|
144
|
-
from ..templates.formatters import render_task_list, format_reason
|
|
145
|
-
|
|
146
|
-
# Render task list section
|
|
147
|
-
tasks_md = render_task_list(doc.active_tasks, header="Active Tasks")
|
|
148
|
-
lines.append(tasks_md)
|
|
149
|
-
|
|
150
|
-
# Format handoff reason
|
|
151
|
-
reason_text = format_reason(doc.reason)
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### In Hooks
|
|
155
|
-
|
|
156
|
-
```python
|
|
157
|
-
from templates.plan_context import get_evaluation_context_reminder
|
|
158
|
-
|
|
159
|
-
# Get plan context template
|
|
160
|
-
CONTEXT_REMINDER = get_evaluation_context_reminder()
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
## Dependent Files
|
|
164
|
-
|
|
165
|
-
Files that import from this module:
|
|
166
|
-
|
|
167
|
-
- `.aiwcli/_shared/lib/context/context_formatter.py`
|
|
168
|
-
- Uses: `get_mode_display`, `get_status_icon`, `format_continuation_header`
|
|
169
|
-
|
|
170
|
-
- `.aiwcli/_shared/lib/handoff/document_generator.py`
|
|
171
|
-
- Uses: `render_task_list`, `format_continuation_header`, `format_reason`
|
|
172
|
-
|
|
173
|
-
- `.aiwcli/_cc-native/hooks/add_plan_context.py`
|
|
174
|
-
- Uses: `get_evaluation_context_reminder`
|
|
175
|
-
|
|
176
|
-
## Design Principles
|
|
177
|
-
|
|
178
|
-
1. **Single Source of Truth**: Each constant/function exists in one location only
|
|
179
|
-
2. **Backward Compatible**: All functions preserve existing output formats
|
|
180
|
-
3. **Type Flexible**: Functions handle both Task objects and dicts
|
|
181
|
-
4. **Fail-Safe**: Use `.get()` with defaults for missing keys
|
|
182
|
-
|
|
183
|
-
## Testing
|
|
184
|
-
|
|
185
|
-
```bash
|
|
186
|
-
# Test imports
|
|
187
|
-
cd .aiwcli
|
|
188
|
-
python -c "from _shared.lib.templates.formatters import get_mode_display; \
|
|
189
|
-
assert get_mode_display('planning') == '[Planning]'"
|
|
190
|
-
|
|
191
|
-
# Test task rendering
|
|
192
|
-
python -c "from _shared.lib.templates.formatters import get_status_icon; \
|
|
193
|
-
assert get_status_icon('pending') != ''"
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
## Synchronization
|
|
197
|
-
|
|
198
|
-
Changes to this module must be synchronized to the template directory:
|
|
199
|
-
|
|
200
|
-
```bash
|
|
201
|
-
# After editing
|
|
202
|
-
cp .aiwcli/_shared/lib/templates/*.py \
|
|
203
|
-
packages/cli/src/templates/_shared/lib/templates/
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
See `CLAUDE.md` for template synchronization requirements.
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"""Shared templates and formatters for context management output.
|
|
2
|
-
|
|
3
|
-
This module provides centralized templates for:
|
|
4
|
-
- Mode displays (planning, implementing, etc.)
|
|
5
|
-
- Status icons (pending, in_progress, completed)
|
|
6
|
-
- Task rendering
|
|
7
|
-
- Context continuation headers
|
|
8
|
-
|
|
9
|
-
Used by context_formatter.py, document_generator.py, and hooks.
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
from .formatters import (
|
|
13
|
-
MODE_DISPLAY_MAP,
|
|
14
|
-
STATUS_ICON_MAP,
|
|
15
|
-
REASON_MAP,
|
|
16
|
-
get_mode_display,
|
|
17
|
-
get_status_icon,
|
|
18
|
-
render_task_item,
|
|
19
|
-
render_task_list,
|
|
20
|
-
format_continuation_header,
|
|
21
|
-
format_reason,
|
|
22
|
-
)
|
|
23
|
-
from .plan_context import get_evaluation_context_reminder
|
|
24
|
-
|
|
25
|
-
__all__ = [
|
|
26
|
-
"MODE_DISPLAY_MAP",
|
|
27
|
-
"STATUS_ICON_MAP",
|
|
28
|
-
"REASON_MAP",
|
|
29
|
-
"get_mode_display",
|
|
30
|
-
"get_status_icon",
|
|
31
|
-
"render_task_item",
|
|
32
|
-
"render_task_list",
|
|
33
|
-
"format_continuation_header",
|
|
34
|
-
"format_reason",
|
|
35
|
-
"get_evaluation_context_reminder",
|
|
36
|
-
]
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"""Formatters for context management templates.
|
|
2
|
-
|
|
3
|
-
Provides constants and helper functions for consistent formatting
|
|
4
|
-
across discovery, handoff, and hook output.
|
|
5
|
-
"""
|
|
6
|
-
|
|
7
|
-
from typing import Any, Dict, List, Optional, Union
|
|
8
|
-
|
|
9
|
-
# Mode display mapping for in-flight work states
|
|
10
|
-
MODE_DISPLAY_MAP = {
|
|
11
|
-
"planning": "[Planning]",
|
|
12
|
-
"pending_implementation": "[Plan Ready]",
|
|
13
|
-
"implementing": "[Implementing]",
|
|
14
|
-
"none": "",
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
# Status icon mapping for task states
|
|
18
|
-
STATUS_ICON_MAP = {
|
|
19
|
-
"pending": "⬜",
|
|
20
|
-
"in_progress": "🔄",
|
|
21
|
-
"blocked": "🚫",
|
|
22
|
-
"completed": "✅",
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def get_mode_display(mode: str) -> str:
|
|
27
|
-
"""Get display string for in-flight mode.
|
|
28
|
-
|
|
29
|
-
Args:
|
|
30
|
-
mode: In-flight mode string (planning, implementing, etc.)
|
|
31
|
-
|
|
32
|
-
Returns:
|
|
33
|
-
Display string like "[Planning]" or empty string for "none"
|
|
34
|
-
"""
|
|
35
|
-
return MODE_DISPLAY_MAP.get(mode, "")
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def get_status_icon(status: str) -> str:
|
|
39
|
-
"""Get emoji icon for task status.
|
|
40
|
-
|
|
41
|
-
Args:
|
|
42
|
-
status: Task status (pending, in_progress, blocked, completed)
|
|
43
|
-
|
|
44
|
-
Returns:
|
|
45
|
-
Emoji icon like "⬜" or "✅"
|
|
46
|
-
"""
|
|
47
|
-
return STATUS_ICON_MAP.get(status, "⬜")
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
def render_task_item(
|
|
51
|
-
task: Union["Task", Dict[str, Any]],
|
|
52
|
-
show_description: bool = True,
|
|
53
|
-
max_description_length: int = 100
|
|
54
|
-
) -> str:
|
|
55
|
-
"""Render single task with status icon and subject.
|
|
56
|
-
|
|
57
|
-
Args:
|
|
58
|
-
task: Task object or dict with status, subject, description
|
|
59
|
-
show_description: Whether to include description
|
|
60
|
-
max_description_length: Maximum length for description before truncating
|
|
61
|
-
|
|
62
|
-
Returns:
|
|
63
|
-
Formatted string: "- {icon} [{STATUS}] {subject}"
|
|
64
|
-
"""
|
|
65
|
-
# Handle both Task objects and dicts
|
|
66
|
-
status = task.get("status") if isinstance(task, dict) else task.status
|
|
67
|
-
subject = task.get("subject") if isinstance(task, dict) else task.subject
|
|
68
|
-
description = task.get("description") if isinstance(task, dict) else task.description
|
|
69
|
-
|
|
70
|
-
icon = get_status_icon(status)
|
|
71
|
-
status_text = f"[{status.upper()}]"
|
|
72
|
-
line = f"- {icon} {status_text} {subject}"
|
|
73
|
-
|
|
74
|
-
if show_description and description:
|
|
75
|
-
truncated = description[:max_description_length]
|
|
76
|
-
if len(description) > max_description_length:
|
|
77
|
-
truncated += "..."
|
|
78
|
-
return f"{line}\n - {truncated}"
|
|
79
|
-
return line
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
def render_task_list(
|
|
83
|
-
tasks: List[Union["Task", Dict[str, Any]]],
|
|
84
|
-
header: Optional[str] = "Active Tasks",
|
|
85
|
-
show_description: bool = True
|
|
86
|
-
) -> str:
|
|
87
|
-
"""Render list of tasks with header.
|
|
88
|
-
|
|
89
|
-
Args:
|
|
90
|
-
tasks: List of Task objects or dicts
|
|
91
|
-
header: Section header text
|
|
92
|
-
show_description: Whether to show task descriptions
|
|
93
|
-
|
|
94
|
-
Returns:
|
|
95
|
-
Formatted markdown section with task list
|
|
96
|
-
"""
|
|
97
|
-
lines = [f"### {header}", ""]
|
|
98
|
-
|
|
99
|
-
if not tasks:
|
|
100
|
-
lines.append("No active tasks.")
|
|
101
|
-
else:
|
|
102
|
-
for task in tasks:
|
|
103
|
-
lines.append(render_task_item(task, show_description))
|
|
104
|
-
|
|
105
|
-
lines.append("")
|
|
106
|
-
return "\n".join(lines)
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
def format_continuation_header(header_type: str, context_id: str) -> str:
|
|
110
|
-
"""Format continuation header for various scenarios.
|
|
111
|
-
|
|
112
|
-
Args:
|
|
113
|
-
header_type: Type of continuation (context, resuming, implementing, handoff)
|
|
114
|
-
context_id: Context identifier
|
|
115
|
-
|
|
116
|
-
Returns:
|
|
117
|
-
Formatted markdown header
|
|
118
|
-
"""
|
|
119
|
-
headers = {
|
|
120
|
-
"context": f"## CONTINUING CONTEXT: {context_id}",
|
|
121
|
-
"resuming": f"## RESUMING FROM HANDOFF: {context_id}",
|
|
122
|
-
"implementing": f"## CONTINUING IMPLEMENTATION: {context_id}",
|
|
123
|
-
"handoff": f"# Session Handoff: {context_id}",
|
|
124
|
-
}
|
|
125
|
-
return headers.get(header_type, f"## {context_id}")
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
# Handoff reason display mapping
|
|
129
|
-
REASON_MAP = {
|
|
130
|
-
"low_context": "Context window running low",
|
|
131
|
-
"user_requested": "User requested handoff",
|
|
132
|
-
"error_recovery": "Error recovery",
|
|
133
|
-
"session_end": "Session ending",
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
def format_reason(reason: str) -> str:
|
|
138
|
-
"""Format handoff reason code as human-readable string.
|
|
139
|
-
|
|
140
|
-
Args:
|
|
141
|
-
reason: Reason code (low_context, user_requested, etc.)
|
|
142
|
-
|
|
143
|
-
Returns:
|
|
144
|
-
Human-readable reason string
|
|
145
|
-
"""
|
|
146
|
-
return REASON_MAP.get(reason, reason)
|
|
Binary file
|
|
Binary file
|