wizz-method 2.0.0 → 2.1.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/LICENSE +60 -30
- package/README.md +80 -31
- package/SECURITY.md +24 -0
- package/THIRD-PARTY-NOTICES.md +136 -0
- package/package.json +31 -17
- package/skills-registry.yaml +128 -7
- package/src/bmm-skills/1-analysis/research/wizz-domain-research/SKILL.md +3 -4
- package/src/bmm-skills/1-analysis/research/wizz-domain-research/domain-steps/step-06-research-synthesis.md +1 -1
- package/src/bmm-skills/1-analysis/research/wizz-market-research/SKILL.md +3 -4
- package/src/bmm-skills/1-analysis/research/wizz-market-research/steps/step-06-research-completion.md +1 -1
- package/src/bmm-skills/1-analysis/research/wizz-technical-research/SKILL.md +3 -4
- package/src/bmm-skills/1-analysis/research/wizz-technical-research/technical-steps/step-06-research-synthesis.md +1 -1
- package/src/bmm-skills/1-analysis/wizz-agent-analyst/SKILL.md +3 -4
- package/src/bmm-skills/1-analysis/wizz-agent-tech-writer/SKILL.md +3 -4
- package/src/bmm-skills/1-analysis/wizz-document-project/SKILL.md +3 -4
- package/src/bmm-skills/1-analysis/wizz-document-project/workflows/deep-dive-instructions.md +1 -1
- package/src/bmm-skills/1-analysis/wizz-document-project/workflows/full-scan-instructions.md +1 -1
- package/src/bmm-skills/1-analysis/wizz-prfaq/SKILL.md +3 -4
- package/src/bmm-skills/1-analysis/wizz-prfaq/references/verdict.md +1 -1
- package/src/bmm-skills/1-analysis/wizz-product-brief/SKILL.md +1 -1
- package/src/bmm-skills/2-plan-workflows/wizz-agent-pm/SKILL.md +3 -4
- package/src/bmm-skills/2-plan-workflows/wizz-agent-ux-designer/SKILL.md +3 -4
- package/src/bmm-skills/2-plan-workflows/wizz-create-prd/SKILL.md +1 -1
- package/src/bmm-skills/2-plan-workflows/wizz-edit-prd/SKILL.md +1 -1
- package/src/bmm-skills/2-plan-workflows/wizz-prd/SKILL.md +1 -1
- package/src/bmm-skills/2-plan-workflows/wizz-ux/SKILL.md +1 -1
- package/src/bmm-skills/2-plan-workflows/wizz-validate-prd/SKILL.md +1 -1
- package/src/bmm-skills/3-solutioning/wizz-agent-architect/SKILL.md +3 -4
- package/src/bmm-skills/3-solutioning/wizz-architecture/SKILL.md +9 -9
- package/src/bmm-skills/3-solutioning/wizz-architecture/references/headless.md +1 -1
- package/src/bmm-skills/3-solutioning/wizz-check-implementation-readiness/SKILL.md +3 -4
- package/src/bmm-skills/3-solutioning/wizz-check-implementation-readiness/steps/step-06-final-assessment.md +1 -1
- package/src/bmm-skills/3-solutioning/wizz-create-architecture/SKILL.md +1 -1
- package/src/bmm-skills/3-solutioning/wizz-create-epics-and-stories/SKILL.md +3 -4
- package/src/bmm-skills/3-solutioning/wizz-create-epics-and-stories/steps/step-04-final-validation.md +1 -1
- package/src/bmm-skills/3-solutioning/wizz-generate-project-context/SKILL.md +3 -4
- package/src/bmm-skills/3-solutioning/wizz-generate-project-context/steps/step-03-complete.md +1 -1
- package/src/bmm-skills/4-implementation/wizz-agent-dev/SKILL.md +3 -4
- package/src/bmm-skills/4-implementation/wizz-checkpoint-preview/SKILL.md +3 -4
- package/src/bmm-skills/4-implementation/wizz-checkpoint-preview/step-05-wrapup.md +1 -1
- package/src/bmm-skills/4-implementation/wizz-code-review/SKILL.md +3 -4
- package/src/bmm-skills/4-implementation/wizz-code-review/customize.toml +3 -8
- package/src/bmm-skills/4-implementation/wizz-code-review/review-prompts/blind-hunter.md +20 -0
- package/src/bmm-skills/4-implementation/wizz-code-review/steps/step-04-present.md +1 -1
- package/src/bmm-skills/4-implementation/wizz-correct-course/SKILL.md +4 -5
- package/src/bmm-skills/4-implementation/wizz-create-story/SKILL.md +4 -5
- package/src/bmm-skills/4-implementation/wizz-dev-story/SKILL.md +4 -5
- package/src/bmm-skills/4-implementation/wizz-investigate/SKILL.md +1 -1
- package/src/bmm-skills/4-implementation/wizz-qa-generate-e2e-tests/SKILL.md +4 -5
- package/src/bmm-skills/4-implementation/wizz-quick-dev/SKILL.md +4 -5
- package/src/bmm-skills/4-implementation/wizz-quick-dev/customize.toml +10 -22
- package/src/bmm-skills/4-implementation/wizz-quick-dev/review-prompts/blind-hunter.md +20 -0
- package/src/bmm-skills/4-implementation/wizz-quick-dev/step-05-present.md +1 -1
- package/src/bmm-skills/4-implementation/wizz-quick-dev/step-oneshot.md +1 -1
- package/src/bmm-skills/4-implementation/wizz-retrospective/SKILL.md +1 -2
- package/src/bmm-skills/4-implementation/wizz-sprint-planning/SKILL.md +1 -1
- package/src/bmm-skills/4-implementation/wizz-sprint-status/SKILL.md +5 -6
- package/src/core-skills/_shared/handoff-protocol.md +9 -0
- package/src/core-skills/wizz-advanced-elicitation/SKILL.md +2 -2
- package/src/core-skills/wizz-brainstorming/SKILL.md +6 -6
- package/src/core-skills/wizz-brainstorming/references/converge.md +1 -1
- package/src/core-skills/wizz-brainstorming/references/finalize.md +1 -1
- package/src/core-skills/wizz-brainstorming/references/headless.md +3 -3
- package/src/core-skills/wizz-brainstorming/references/mode-autonomous.md +1 -1
- package/src/core-skills/wizz-customize/SKILL.md +13 -10
- package/src/core-skills/wizz-forge-idea/SKILL.md +6 -6
- package/src/core-skills/wizz-forge-idea/scripts/__pycache__/resolve_personas.cpython-314.pyc +0 -0
- package/src/core-skills/wizz-forge-idea/scripts/resolve_personas.py +17 -1
- package/src/core-skills/wizz-party-mode/SKILL.md +3 -3
- package/src/core-skills/wizz-party-mode/references/create-party.md +1 -1
- package/src/core-skills/wizz-party-mode/references/party-memory.md +2 -2
- package/src/core-skills/wizz-party-mode/scripts/__pycache__/resolve_party.cpython-314.pyc +0 -0
- package/src/core-skills/wizz-party-mode/scripts/resolve_party.py +17 -1
- package/src/core-skills/wizz-review-adversarial-general/SKILL.md +1 -1
- package/src/core-skills/wizz-spec/SKILL.md +5 -5
- package/src/modules/lowticket/README.md +6 -6
- package/src/modules/lowticket/module.yaml +4 -1
- package/src/modules/lowticket/skills/{lowticket-funil → wizz-lowticket-funil}/SKILL.md +4 -4
- package/src/modules/lowticket/skills/{lowticket-funil → wizz-lowticket-funil}/references/copy-das-paginas.md +1 -1
- package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/SKILL.md +1 -1
- package/src/modules/lowticket/skills/{lowticket-minerador → wizz-lowticket-minerador}/SKILL.md +3 -3
- package/src/modules/lowticket/skills/{lowticket-minerador → wizz-lowticket-minerador}/references/rubrica.md +1 -1
- package/src/modules/lowticket/skills/{lowticket-pagina → wizz-lowticket-pagina}/SKILL.md +4 -4
- package/src/modules/lowticket/skills/{lowticket-trafego → wizz-lowticket-trafego}/SKILL.md +3 -3
- package/src/modules/lowticket/skills/{lowticket-trafego → wizz-lowticket-trafego}/references/reguas.md +1 -1
- package/src/modules/wizz/_shared/communication-rules.md +1 -1
- package/src/modules/wizz/_shared/despacho-barato.md +9 -0
- package/src/modules/wizz/_shared/token-economy.md +7 -0
- package/src/modules/wizz/agents/wizz-ads/SKILL.md +1 -1
- package/src/modules/wizz/agents/wizz-ads/customize.toml +1 -2
- package/src/modules/wizz/agents/wizz-copy/SKILL.md +1 -1
- package/src/modules/wizz/agents/wizz-copy/customize.toml +1 -2
- package/src/modules/wizz/agents/wizz-designer/SKILL.md +1 -1
- package/src/modules/wizz/agents/wizz-designer/customize.toml +1 -2
- package/src/modules/wizz/agents/wizz-growth/SKILL.md +1 -1
- package/src/modules/wizz/agents/wizz-growth/customize.toml +1 -2
- package/src/modules/wizz/agents/wizz-maestro/SKILL.md +5 -5
- package/src/modules/wizz/agents/wizz-maestro/customize.toml +4 -8
- package/src/modules/wizz/agents/wizz-memoria/SKILL.md +1 -1
- package/src/modules/wizz/agents/wizz-memoria/customize.toml +1 -2
- package/src/modules/wizz/agents/wizz-qa/SKILL.md +1 -1
- package/src/modules/wizz/agents/wizz-qa/customize.toml +1 -2
- package/src/modules/wizz/agents/wizz-seo/SKILL.md +1 -1
- package/src/modules/wizz/agents/wizz-seo/customize.toml +1 -2
- package/src/modules/wizz/agents/wizz-social/SKILL.md +1 -1
- package/src/modules/wizz/agents/wizz-social/customize.toml +1 -2
- package/src/modules/wizz/module.yaml +3 -0
- package/src/modules/wizz/overrides/wizz-agent-analyst.toml +1 -2
- package/src/modules/wizz/overrides/wizz-agent-architect.toml +1 -2
- package/src/modules/wizz/overrides/wizz-agent-dev.toml +1 -2
- package/src/modules/wizz/overrides/wizz-agent-pm.toml +1 -2
- package/src/modules/wizz/overrides/wizz-agent-tech-writer.toml +1 -2
- package/src/modules/wizz/overrides/wizz-agent-ux-designer.toml +1 -2
- package/src/modules/wizz/subagents/codex/wizz-exec-haiku.toml +2 -0
- package/src/modules/wizz/subagents/codex/wizz-exec-opus.toml +2 -0
- package/src/modules/wizz/subagents/codex/wizz-exec-review.toml +2 -0
- package/src/modules/wizz/subagents/codex/wizz-exec-sonnet.toml +2 -0
- package/src/modules/wizz/subagents/gemini/wizz-exec-haiku.md +4 -1
- package/src/modules/wizz/subagents/gemini/wizz-exec-opus.md +4 -1
- package/src/modules/wizz/subagents/gemini/wizz-exec-review.md +4 -1
- package/src/modules/wizz/subagents/gemini/wizz-exec-sonnet.md +4 -1
- package/src/modules/wizz/subagents/opencode/wizz-exec-haiku.md +4 -1
- package/src/modules/wizz/subagents/opencode/wizz-exec-opus.md +4 -1
- package/src/modules/wizz/subagents/opencode/wizz-exec-review.md +4 -1
- package/src/modules/wizz/subagents/opencode/wizz-exec-sonnet.md +4 -1
- package/src/modules/wizz/subagents/spec.yaml +148 -0
- package/src/modules/wizz/subagents/wizz-exec-haiku.md +4 -1
- package/src/modules/wizz/subagents/wizz-exec-opus.md +4 -1
- package/src/modules/wizz/subagents/wizz-exec-review.md +4 -1
- package/src/modules/wizz/subagents/wizz-exec-sonnet.md +4 -1
- package/src/scripts/__pycache__/resolve_customization.cpython-314.pyc +0 -0
- package/src/scripts/memlog.js +368 -0
- package/src/scripts/resolve_customization.py +124 -15
- package/src/skills-lib/_shared/complexity-signal.md +14 -0
- package/src/skills-lib/wizz-canvas-design/canvas-fonts/InstrumentSerif-OFL.txt +93 -0
- package/src/skills-lib/wizz-huashu-design/references/sfx-library.md +1 -1
- package/src/skills-lib/wizz-huashu-design/scripts/add-music.sh +1 -1
- package/src/skills-lib/wizz-huashu-design/scripts/mix-voiceover.sh +1 -1
- package/src/skills-lib/wizz-impeccable/LICENSE.txt +202 -0
- package/src/skills-lib/wizz-offer-forge/SKILL.md +1 -1
- package/src/skills-lib/wizz-react-components/LICENSE.txt +202 -0
- package/src/skills-lib/wizz-router/SKILL.md +2 -2
- package/src/skills-lib/wizz-supabase-postgres-best-practices/LICENSE +21 -0
- package/src/skills-lib/wizz-taste-skill/SKILL.md +1 -1
- package/src/skills-lib/wizz-tracking-audit/SKILL.md +1 -1
- package/tools/fetch-assets.mjs +62 -37
- package/tools/hooks/README.md +22 -0
- package/tools/hooks/rtk-rewrite.sh +280 -0
- package/tools/hooks/security-defensive-context.js +70 -0
- package/tools/hooks/session-rules.js +368 -0
- package/tools/hooks/wizz-decision-trace.js +389 -0
- package/tools/hooks/wizz-router-enforce.js +258 -0
- package/tools/installer/banner.js +1 -1
- package/tools/installer/commands/doctor.js +124 -0
- package/tools/installer/commands/install.js +1 -1
- package/tools/installer/commands/resolve.js +95 -0
- package/tools/installer/core/doctor.js +648 -0
- package/tools/installer/core/hash-cache.js +156 -0
- package/tools/installer/core/help-catalog.js +4 -1
- package/tools/installer/core/hooks-settings.js +178 -0
- package/tools/installer/core/installer.js +297 -15
- package/tools/installer/core/legacy-warnings.js +0 -4
- package/tools/installer/core/manifest-generator.js +121 -43
- package/tools/installer/core/manifest.js +36 -32
- package/tools/installer/core/module-config-writer.js +4 -1
- package/tools/installer/core/python-check.js +60 -63
- package/tools/installer/core/quick-update.js +76 -43
- package/tools/installer/core/resolved-config.js +168 -0
- package/tools/installer/core/resolved-customizations.js +736 -0
- package/tools/installer/core/resolved-includes.js +262 -0
- package/tools/installer/core/resolved-schema.js +148 -0
- package/tools/installer/core/user-file-preservation.js +40 -8
- package/tools/installer/core/wizz-dir.js +117 -0
- package/tools/installer/core/yaml-cache.js +105 -0
- package/tools/installer/fs-native.js +97 -6
- package/tools/installer/ide/_config-driven.js +12 -75
- package/tools/installer/ide/platform-codes.js +111 -16
- package/tools/installer/ide/platform-codes.yaml +45 -100
- package/tools/installer/ide/shared/path-utils.js +6 -208
- package/tools/installer/install-messages.yaml +4 -14
- package/tools/installer/modules/channel-plan.js +15 -2
- package/tools/installer/modules/config-collector.js +762 -0
- package/tools/installer/modules/config-values.js +352 -0
- package/tools/installer/modules/custom-module-manager.js +161 -28
- package/tools/installer/modules/env-vars.js +119 -0
- package/tools/installer/modules/external-manager.js +133 -60
- package/tools/installer/modules/git-cache-utils.js +125 -0
- package/tools/installer/modules/module-catalog.js +565 -0
- package/tools/installer/modules/module-installer.js +618 -0
- package/tools/installer/modules/module-interface.js +86 -0
- package/tools/installer/modules/official-modules.js +98 -2172
- package/tools/installer/modules/pin-spec.js +125 -0
- package/tools/installer/modules/plugin-resolver.js +4 -0
- package/tools/installer/modules/skills-lib.js +3 -6
- package/tools/installer/prompts.js +0 -3
- package/tools/installer/ui.js +89 -54
- package/tools/installer/wizz-cli.js +1 -1
- package/tools/lib/frontmatter.js +139 -0
- package/tools/lib/sync-targets.mjs +49 -0
- package/tools/lib/walk.js +93 -0
- package/wizz-modules.yaml +9 -0
- package/src/scripts/__pycache__/memlog.cpython-313.pyc +0 -0
- package/src/scripts/memlog.py +0 -233
- package/src/scripts/tests/__pycache__/test_memlog.cpython-313-pytest-9.1.1.pyc +0 -0
- package/src/scripts/tests/__pycache__/test_resolve_customization.cpython-313-pytest-9.1.1.pyc +0 -0
- package/src/scripts/tests/test_memlog.py +0 -306
- package/src/skills-lib/wizz-huashu-design/assets/showcases/INDEX.md +0 -115
- package/src/skills-lib/wizz-huashu-design/assets/showcases/cover/cover-build.html +0 -235
- package/src/skills-lib/wizz-huashu-design/assets/showcases/cover/cover-build.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/cover/cover-pentagram.html +0 -229
- package/src/skills-lib/wizz-huashu-design/assets/showcases/cover/cover-pentagram.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/cover/cover-takram.html +0 -288
- package/src/skills-lib/wizz-huashu-design/assets/showcases/cover/cover-takram.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/infographic/infographic-build.html +0 -503
- package/src/skills-lib/wizz-huashu-design/assets/showcases/infographic/infographic-build.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/infographic/infographic-pentagram.html +0 -600
- package/src/skills-lib/wizz-huashu-design/assets/showcases/infographic/infographic-pentagram.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/infographic/infographic-takram.html +0 -670
- package/src/skills-lib/wizz-huashu-design/assets/showcases/infographic/infographic-takram.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/ppt/ppt-build.html +0 -382
- package/src/skills-lib/wizz-huashu-design/assets/showcases/ppt/ppt-build.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/ppt/ppt-pentagram.html +0 -536
- package/src/skills-lib/wizz-huashu-design/assets/showcases/ppt/ppt-pentagram.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/ppt/ppt-takram.html +0 -497
- package/src/skills-lib/wizz-huashu-design/assets/showcases/ppt/ppt-takram.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-ai-nav/ainav-build.html +0 -385
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-ai-nav/ainav-build.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-ai-nav/ainav-pentagram.html +0 -422
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-ai-nav/ainav-pentagram.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-ai-nav/ainav-takram.html +0 -499
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-ai-nav/ainav-takram.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-ai-writing/aiwriting-build.html +0 -562
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-ai-writing/aiwriting-build.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-ai-writing/aiwriting-pentagram.html +0 -548
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-ai-writing/aiwriting-pentagram.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-ai-writing/aiwriting-takram.html +0 -696
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-ai-writing/aiwriting-takram.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-devdocs/devdocs-build.html +0 -372
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-devdocs/devdocs-build.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-devdocs/devdocs-pentagram.html +0 -460
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-devdocs/devdocs-pentagram.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-devdocs/devdocs-takram.html +0 -494
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-devdocs/devdocs-takram.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-homepage/homepage-build.html +0 -367
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-homepage/homepage-build.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-homepage/homepage-pentagram.html +0 -368
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-homepage/homepage-pentagram.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-homepage/homepage-takram.html +0 -459
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-homepage/homepage-takram.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-saas/saas-build.html +0 -493
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-saas/saas-build.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-saas/saas-pentagram.html +0 -556
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-saas/saas-pentagram.png +0 -0
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-saas/saas-takram.html +0 -604
- package/src/skills-lib/wizz-huashu-design/assets/showcases/website-saas/saas-takram.png +0 -0
- package/tools/installer/file-ops.js +0 -204
- package/tools/installer/ide/shared/skill-manifest.js +0 -57
- package/tools/installer/yaml-format.js +0 -245
- package/web-bundles/README.md +0 -46
- package/web-bundles/brainstorming-coach/INSTRUCTIONS.md +0 -86
- package/web-bundles/brainstorming-coach/SKILL.md +0 -83
- package/web-bundles/brainstorming-coach/brain-methods.csv +0 -62
- package/web-bundles/bundles.json +0 -139
- package/web-bundles/market-and-industry-research/INSTRUCTIONS.md +0 -88
- package/web-bundles/market-and-industry-research/SKILL.md +0 -59
- package/web-bundles/prd-coach/INSTRUCTIONS.md +0 -86
- package/web-bundles/prd-coach/SKILL.md +0 -101
- package/web-bundles/prd-coach/prd-template.md +0 -165
- package/web-bundles/prd-coach/prd-validation-checklist.md +0 -135
- package/web-bundles/prfaq-coach/INSTRUCTIONS.md +0 -86
- package/web-bundles/prfaq-coach/SKILL.md +0 -139
- package/web-bundles/product-brief-coach/INSTRUCTIONS.md +0 -86
- package/web-bundles/product-brief-coach/SKILL.md +0 -113
- package/web-bundles/ux-coach/INSTRUCTIONS.md +0 -92
- package/web-bundles/ux-coach/SKILL.md +0 -187
- package/web-bundles/ux-coach/ux-validation.md +0 -100
- /package/src/modules/lowticket/skills/{lowticket-funil → wizz-lowticket-funil}/references/mapa-do-funil.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/CATALOGO.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/01-principios.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/02-diagnostico-funil.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/03-campanha-bidcap.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/04-criativos.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/04a-criativos-ia.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/04b-criativos-formatos.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/05-oferta.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/06-pagina-vendas.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/06a-instagram.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/06b-player-vsl.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/07-funil-upsell.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/07a-copy-humanizacao.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/08-pesquisa-publico.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/09-especialista-coproducao.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/10-levantar-caixa.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/11-checklist-roi.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/12-mineracao-ofertas.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/12a-mineracao-veredito.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/12b-fabrica-de-ofertas.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/12c-anatomia-low-ticket.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/13-benchmarks-vsl.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/14-vocabulario.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/15-como-estender.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/17-rastreamento.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/18-copy-desejo-oferta.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/INDEX.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/guardrails.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/knowledge/pontos-em-aberto.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-metodologia → wizz-lowticket-metodologia}/references/swipe-file.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-pagina → wizz-lowticket-pagina}/references/metas-e-medicao.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-pagina → wizz-lowticket-pagina}/references/padroes-de-codigo.md +0 -0
- /package/src/modules/lowticket/skills/{lowticket-trafego → wizz-lowticket-trafego}/references/formato-do-diagnostico.md +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// sync-targets.mjs — fonte única da lista de sincronização repo → ~/.claude.
|
|
2
|
+
//
|
|
3
|
+
// Usado por tools/sync-global.mjs (escreve: repo → ~/.claude) e
|
|
4
|
+
// tools/sync-check.mjs (só lê: compara hash repo vs ~/.claude, sem escrever).
|
|
5
|
+
// Mudou o que sincroniza? Mude só aqui — os dois scripts leem a mesma lista,
|
|
6
|
+
// então não podem driftar entre si (essa era exatamente a lacuna que gerou
|
|
7
|
+
// a tarefa 2.7 da auditoria: o M10 aponta sync manual e esquecível).
|
|
8
|
+
//
|
|
9
|
+
// O que sincroniza hoje:
|
|
10
|
+
// 1. Hooks: tools/hooks/*.js e *.sh → ~/.claude/hooks/
|
|
11
|
+
// 2. Skills: src/skills-lib/<id>/ → ~/.claude/skills/<id>/
|
|
12
|
+
// (apenas skills que JÁ existem no destino — sync-global não instala
|
|
13
|
+
// skill nova, e sync-check só compara o que já está instalado)
|
|
14
|
+
|
|
15
|
+
import fs from 'node:fs';
|
|
16
|
+
import path from 'node:path';
|
|
17
|
+
|
|
18
|
+
/** Diretório de origem dos hooks, dentro do repo. */
|
|
19
|
+
export function hooksSrcDir(repoRoot) {
|
|
20
|
+
return path.join(repoRoot, 'tools', 'hooks');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Diretório de origem das skills, dentro do repo. */
|
|
24
|
+
export function skillsSrcDir(repoRoot) {
|
|
25
|
+
return path.join(repoRoot, 'src', 'skills-lib');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Lista os arquivos de hook na origem (tools/hooks/*.js e *.sh).
|
|
30
|
+
* Retorna nomes de arquivo (não paths completos).
|
|
31
|
+
*/
|
|
32
|
+
export function listHookFiles(repoRoot) {
|
|
33
|
+
const src = hooksSrcDir(repoRoot);
|
|
34
|
+
if (!fs.existsSync(src)) return [];
|
|
35
|
+
return fs.readdirSync(src).filter((f) => f.endsWith('.js') || f.endsWith('.sh'));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Lista os ids de skill na origem (src/skills-lib/<id>/ com SKILL.md —
|
|
40
|
+
* exclui pastas auxiliares como references/ que não são skills em si).
|
|
41
|
+
*/
|
|
42
|
+
export function listSkillIds(repoRoot) {
|
|
43
|
+
const src = skillsSrcDir(repoRoot);
|
|
44
|
+
if (!fs.existsSync(src)) return [];
|
|
45
|
+
return fs.readdirSync(src).filter((id) => {
|
|
46
|
+
const dir = path.join(src, id);
|
|
47
|
+
return fs.statSync(dir).isDirectory() && fs.existsSync(path.join(dir, 'SKILL.md'));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Walk de arquivos/diretórios compartilhado pelos validadores do repo.
|
|
2
|
+
//
|
|
3
|
+
// M15 (auditoria 2026-07-07): `walkFiles` + skip-dirs estava reimplementado
|
|
4
|
+
// de forma divergente em validate-method-refs.js e validate-file-refs.js, e
|
|
5
|
+
// validate-skills.js tinha dois walks próprios (um de diretórios de skill,
|
|
6
|
+
// outro de arquivos dentro de uma skill). Esta lib extrai o padrão comum
|
|
7
|
+
// (recursão + skip-dirs) sem impor um comportamento único: cada chamador
|
|
8
|
+
// passa as opções (`skipDirs`, `extensions`) que preservam o que já tinha.
|
|
9
|
+
//
|
|
10
|
+
// Uso: `require('../tools/lib/walk')` a partir de qualquer validador em
|
|
11
|
+
// tools/*.js (CommonJS, igual aos validadores).
|
|
12
|
+
|
|
13
|
+
const fs = require('node:fs');
|
|
14
|
+
const path = require('node:path');
|
|
15
|
+
|
|
16
|
+
const DEFAULT_SKIP_DIRS = new Set(['node_modules', '.git']);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Coleta recursivamente os caminhos de arquivo sob `root`.
|
|
20
|
+
*
|
|
21
|
+
* - Se `root` for um arquivo (não diretório), devolve `[root]` (respeitando
|
|
22
|
+
* o filtro de extensão) — permite tratar um arquivo solto e um diretório
|
|
23
|
+
* pela mesma chamada (comportamento herdado de
|
|
24
|
+
* validate-method-refs.js:walkFiles, que recebe tanto `README.md` quanto
|
|
25
|
+
* `docs/` na mesma lista `SCAN_ROOTS`).
|
|
26
|
+
* - `skipDirs`: nomes de diretório a pular, comparados com `entry.name`
|
|
27
|
+
* (não é path completo). Default: `{node_modules, .git}`.
|
|
28
|
+
* - `extensions`: `Set<string>` de extensões (com ponto, ex: `.md`) a
|
|
29
|
+
* incluir. Omitido/null = todos os arquivos (comportamento herdado de
|
|
30
|
+
* validate-skills.js:collectSkillFiles, que não filtra por extensão).
|
|
31
|
+
*
|
|
32
|
+
* @param {string} root - Caminho absoluto (arquivo ou diretório)
|
|
33
|
+
* @param {{skipDirs?: Set<string>, extensions?: Set<string>|null}} [opts]
|
|
34
|
+
* @returns {string[]} Caminhos absolutos, em ordem de descoberta (não ordenado)
|
|
35
|
+
*/
|
|
36
|
+
function walkFiles(root, opts = {}) {
|
|
37
|
+
const skipDirs = opts.skipDirs || DEFAULT_SKIP_DIRS;
|
|
38
|
+
const extensions = opts.extensions || null;
|
|
39
|
+
if (!fs.existsSync(root)) return [];
|
|
40
|
+
|
|
41
|
+
const matches = (file) => !extensions || extensions.has(path.extname(file));
|
|
42
|
+
|
|
43
|
+
const stat = fs.statSync(root);
|
|
44
|
+
if (stat.isFile()) return matches(root) ? [root] : [];
|
|
45
|
+
|
|
46
|
+
const files = [];
|
|
47
|
+
const walk = (dir) => {
|
|
48
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
49
|
+
if (entry.isDirectory()) {
|
|
50
|
+
if (skipDirs.has(entry.name)) continue;
|
|
51
|
+
walk(path.join(dir, entry.name));
|
|
52
|
+
} else if (entry.isFile()) {
|
|
53
|
+
const full = path.join(dir, entry.name);
|
|
54
|
+
if (matches(full)) files.push(full);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
walk(root);
|
|
59
|
+
return files;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Encontra, recursivamente sob cada diretório em `rootDirs`, os diretórios
|
|
64
|
+
* que contêm diretamente o arquivo `markerFile` (ex.: `SKILL.md`). Continua
|
|
65
|
+
* descendo mesmo depois de achar um marcador (skills podem estar aninhadas).
|
|
66
|
+
*
|
|
67
|
+
* Usado por validate-skills.js:discoverSkillDirs para descobrir skills sem
|
|
68
|
+
* reimplementar o walk de novo.
|
|
69
|
+
*
|
|
70
|
+
* @param {string[]} rootDirs - Diretórios raiz onde procurar
|
|
71
|
+
* @param {string} markerFile - Nome do arquivo marcador (ex.: 'SKILL.md')
|
|
72
|
+
* @param {{skipDirs?: Set<string>}} [opts]
|
|
73
|
+
* @returns {string[]} Diretórios (absolutos) que contêm o marcador, ordenados
|
|
74
|
+
*/
|
|
75
|
+
function findDirsWithFile(rootDirs, markerFile, opts = {}) {
|
|
76
|
+
const skipDirs = opts.skipDirs || DEFAULT_SKIP_DIRS;
|
|
77
|
+
const found = [];
|
|
78
|
+
|
|
79
|
+
const walk = (dir) => {
|
|
80
|
+
if (!fs.existsSync(dir)) return;
|
|
81
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
82
|
+
if (!entry.isDirectory() || skipDirs.has(entry.name)) continue;
|
|
83
|
+
const full = path.join(dir, entry.name);
|
|
84
|
+
if (fs.existsSync(path.join(full, markerFile))) found.push(full);
|
|
85
|
+
walk(full);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
for (const rootDir of rootDirs) walk(rootDir);
|
|
90
|
+
return found.sort();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
module.exports = { walkFiles, findDirsWithFile, DEFAULT_SKIP_DIRS };
|
package/wizz-modules.yaml
CHANGED
|
@@ -41,6 +41,15 @@
|
|
|
41
41
|
# An existing install recorded under an alias resolves to this entry instead of
|
|
42
42
|
# being orphaned as "no source available" when the code changes.
|
|
43
43
|
#
|
|
44
|
+
# interface_version (optional, in the MODULE's own module.yaml, not in this
|
|
45
|
+
# file) — the version of the module.yaml contract the module was written
|
|
46
|
+
# against (auditoria 2026-09-11, item 25; see
|
|
47
|
+
# tools/installer/modules/module-interface.js). Omit it and the installer
|
|
48
|
+
# treats the module as interface_version 1 (every module written before this
|
|
49
|
+
# contract existed). The installer refuses to install a module declaring an
|
|
50
|
+
# interface_version higher than it supports, with a message telling the user
|
|
51
|
+
# to update wizz-method or use a compatible module version.
|
|
52
|
+
#
|
|
44
53
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
45
54
|
# NOT LISTED HERE: bundled local modules.
|
|
46
55
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
Binary file
|
package/src/scripts/memlog.py
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# /// script
|
|
3
|
-
# requires-python = ">=3.8"
|
|
4
|
-
# ///
|
|
5
|
-
"""memlog — an append-only memory log: LLM-optimal working memory for a skill.
|
|
6
|
-
|
|
7
|
-
A memlog is the dense, chronological record of everything that mattered in a piece of
|
|
8
|
-
work — every item the user generated or accepted — kept minimal like human memory: only
|
|
9
|
-
what's important, never bloated. It persists ACROSS sessions, so a fresh session can
|
|
10
|
-
load it and continue. It is NOT a deliverable; downstream artifacts (a brief, a PRD, a
|
|
11
|
-
deck, a report) are *derived* from it on demand. The host skill supplies the vocabulary
|
|
12
|
-
by how it calls `append` — the tool stays neutral.
|
|
13
|
-
|
|
14
|
-
It is a FLAT log: there are no sections or grouping. Every entry is one line, recorded
|
|
15
|
-
at the END in the order it happened. The chronology itself is the structure — an event
|
|
16
|
-
like "started technique X" is just another entry, same as an idea or an insight.
|
|
17
|
-
|
|
18
|
-
Three invariants make it trustworthy:
|
|
19
|
-
|
|
20
|
-
1. Append-only, chronological. Entries land at the end, in the order they happen.
|
|
21
|
-
Nothing is ever inserted backward, reordered, edited, or removed. There is no
|
|
22
|
-
edit or delete subcommand by design; history is never rewritten.
|
|
23
|
-
2. Write-only / blind. Every command is an atomic, context-free write and echoes the
|
|
24
|
-
new state as one line of JSON, so the caller never re-reads the file mid-session.
|
|
25
|
-
The one time the file is read is on resume — and the caller reads it itself, not
|
|
26
|
-
via this script.
|
|
27
|
-
3. No lifecycle status. A memory log has no "complete" flag. Whether the work is done,
|
|
28
|
-
blocked, or paused is itself a fact that happened, so it is recorded as an entry
|
|
29
|
-
(e.g. `append --type event --text "session complete"`), never as frontmatter the
|
|
30
|
-
log would have to mutate. The chronology stays the single source of truth, and a
|
|
31
|
-
resume learns the state by reading the last entries — the same way it learns
|
|
32
|
-
everything else.
|
|
33
|
-
|
|
34
|
-
Atomicity: every write goes to a temp file, is flushed and fsync'd, then atomically
|
|
35
|
-
renamed over the target, so a crash never leaves a half-written entry.
|
|
36
|
-
|
|
37
|
-
Known limitation (by design, not a bug): there is no compaction, archival, or size
|
|
38
|
-
cap. Append-only + no lifecycle status (invariant 3 above) means a `.memlog.md` grows
|
|
39
|
-
without bound for the life of the workspace — fine for a single brainstorm/spec/
|
|
40
|
-
architecture session (dozens to low hundreds of entries), but a caller resuming a very
|
|
41
|
-
long-running or repeatedly-reused workspace pays an ever-larger read on every resume.
|
|
42
|
-
If that ever becomes a real problem, the fix is a new host-skill-driven step (e.g.
|
|
43
|
-
"archive entries older than the last milestone to a sibling file"), not a change to
|
|
44
|
-
this script's invariants — memlog stays a dumb, trustworthy, append-only primitive.
|
|
45
|
-
|
|
46
|
-
The file shape (.memlog.md):
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
topic: Onboarding flow for a budgeting app
|
|
50
|
-
goal: lift week-1 retention
|
|
51
|
-
updated: 2026-06-07T14:22
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
- (note) user picked techniques: SCAMPER, then Six Thinking Hats
|
|
55
|
-
- (technique) started SCAMPER
|
|
56
|
-
- (idea) skip the signup wall: let people try with sample data first
|
|
57
|
-
- (idea) auto-import one bank account so the first screen shows real numbers
|
|
58
|
-
- (question) is open-banking consent too heavy for step one?
|
|
59
|
-
- (insight) the "scary numbers" risk and the "real numbers" idea are one lever: show real data, pre-categorized
|
|
60
|
-
- (direction) optimize for the anxious first-timer, not the power user
|
|
61
|
-
- (decision) lead with one pre-categorized account; defer multi-account import
|
|
62
|
-
- (event) session complete
|
|
63
|
-
|
|
64
|
-
Each entry may carry an optional `--type` — what KIND it is (idea, insight, question,
|
|
65
|
-
decision, direction, assumption, gap, note, event, …) — and an optional `--by` naming
|
|
66
|
-
who it came from (e.g. `user`, `coach`), for sessions where authorship matters. Both
|
|
67
|
-
render into one short inline tag: `(idea)`, `(idea by user)`, `(by coach)`. Omit them
|
|
68
|
-
for a plain note. The host skill names the vocabulary; the script does not enforce one.
|
|
69
|
-
|
|
70
|
-
Commands:
|
|
71
|
-
init (--workspace DIR | --path FILE) [--field k=v ...] create the memlog (errors if it exists)
|
|
72
|
-
append (--workspace DIR | --path FILE) --text STR [--type T] [--by W] append one entry at the end
|
|
73
|
-
set (--workspace DIR | --path FILE) --key K --value V set/replace a descriptive frontmatter field
|
|
74
|
-
|
|
75
|
-
Addressing: `--workspace` is the run folder, and the memlog is always {workspace}/.memlog.md.
|
|
76
|
-
`--path` points straight at the memlog file instead, for callers that already hold the path.
|
|
77
|
-
"""
|
|
78
|
-
from __future__ import annotations # keep type-hint syntax lazy so the script runs on 3.8+
|
|
79
|
-
|
|
80
|
-
import argparse
|
|
81
|
-
import json
|
|
82
|
-
import os
|
|
83
|
-
import sys
|
|
84
|
-
from datetime import datetime
|
|
85
|
-
from pathlib import Path
|
|
86
|
-
|
|
87
|
-
MEMLOG = ".memlog.md"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
def now() -> str:
|
|
91
|
-
return datetime.now().strftime("%Y-%m-%dT%H:%M")
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
def resolve(args) -> Path:
|
|
95
|
-
"""The memlog file, from either addressing mode: {workspace}/.memlog.md or an explicit --path."""
|
|
96
|
-
return Path(args.path) if args.path else Path(args.workspace) / MEMLOG
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
def split(text: str) -> tuple[dict, str]:
|
|
100
|
-
"""Return (frontmatter dict in source order, body str). Frontmatter is plain key: value.
|
|
101
|
-
|
|
102
|
-
The closing fence is the first line that is *exactly* `---`, so a `---` inside a
|
|
103
|
-
field value (topic/goal are free user text) never truncates the frontmatter.
|
|
104
|
-
"""
|
|
105
|
-
lines = text.splitlines()
|
|
106
|
-
if not lines or lines[0] != "---":
|
|
107
|
-
raise ValueError(".memlog.md has no frontmatter")
|
|
108
|
-
end = next((i for i in range(1, len(lines)) if lines[i] == "---"), None)
|
|
109
|
-
if end is None:
|
|
110
|
-
raise ValueError(".memlog.md frontmatter is not terminated")
|
|
111
|
-
meta: dict[str, str] = {}
|
|
112
|
-
for line in lines[1:end]:
|
|
113
|
-
if ":" in line:
|
|
114
|
-
k, v = line.split(":", 1)
|
|
115
|
-
meta[k.strip()] = v.strip()
|
|
116
|
-
return meta, "\n".join(lines[end + 1:]).lstrip("\n")
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
def render(meta: dict, body: str) -> str:
|
|
120
|
-
# Neutralize newlines in values so a multi-line field can't break the fence on re-read.
|
|
121
|
-
fm = "\n".join(f"{k}: {' '.join(str(v).splitlines())}" for k, v in meta.items())
|
|
122
|
-
return "---\n" + fm + "\n---\n\n" + body.rstrip("\n") + "\n"
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
def touch(meta: dict) -> None:
|
|
126
|
-
"""Stamp `updated` and keep it last so the field order stays predictable."""
|
|
127
|
-
meta.pop("updated", None)
|
|
128
|
-
meta["updated"] = now()
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
def write_atomic(path: Path, text: str) -> None:
|
|
132
|
-
"""Temp + flush + fsync + atomic rename, so a crash never half-writes an entry."""
|
|
133
|
-
tmp = path.with_suffix(path.suffix + ".tmp")
|
|
134
|
-
with open(tmp, "w", encoding="utf-8") as f:
|
|
135
|
-
f.write(text)
|
|
136
|
-
f.flush()
|
|
137
|
-
os.fsync(f.fileno())
|
|
138
|
-
os.replace(tmp, path)
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
def entry_count(body: str) -> int:
|
|
142
|
-
return sum(1 for ln in body.splitlines() if ln.startswith("- "))
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
def ack(path: Path, body: str) -> None:
|
|
146
|
-
"""Echo new state so the caller never re-reads the file to know where it stands."""
|
|
147
|
-
print(json.dumps({
|
|
148
|
-
"ok": True,
|
|
149
|
-
"memlog": str(path),
|
|
150
|
-
"entries": entry_count(body),
|
|
151
|
-
}))
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
def cmd_init(args) -> int:
|
|
155
|
-
path = resolve(args)
|
|
156
|
-
if path.exists():
|
|
157
|
-
print(f"error: {path} already exists; use append/set to update it", file=sys.stderr)
|
|
158
|
-
return 2
|
|
159
|
-
path.parent.mkdir(parents=True, exist_ok=True)
|
|
160
|
-
meta: dict[str, str] = {}
|
|
161
|
-
for pair in args.field or []:
|
|
162
|
-
if "=" not in pair:
|
|
163
|
-
print(f"error: --field expects key=value, got {pair!r}", file=sys.stderr)
|
|
164
|
-
return 2
|
|
165
|
-
k, v = pair.split("=", 1)
|
|
166
|
-
meta[k.strip()] = v.strip()
|
|
167
|
-
touch(meta)
|
|
168
|
-
write_atomic(path, render(meta, ""))
|
|
169
|
-
ack(path, "")
|
|
170
|
-
return 0
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
def cmd_append(args) -> int:
|
|
174
|
-
path = resolve(args)
|
|
175
|
-
meta, body = split(path.read_text(encoding="utf-8"))
|
|
176
|
-
text = " ".join(args.text.split()) # collapse newlines/runs → one-line entry, no prose bloat
|
|
177
|
-
label = args.type or ""
|
|
178
|
-
if args.by:
|
|
179
|
-
label = f"{label} by {args.by}".strip() # attribution: "(idea by user)" / "(by coach)"
|
|
180
|
-
tag = f"({label}) " if label else ""
|
|
181
|
-
entry = f"- {tag}{text}"
|
|
182
|
-
body = (body.rstrip("\n") + "\n" + entry) if body.strip() else entry # always at the end
|
|
183
|
-
touch(meta)
|
|
184
|
-
write_atomic(path, render(meta, body))
|
|
185
|
-
ack(path, body)
|
|
186
|
-
return 0
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
def cmd_set(args) -> int:
|
|
190
|
-
path = resolve(args)
|
|
191
|
-
meta, body = split(path.read_text(encoding="utf-8"))
|
|
192
|
-
meta[args.key] = args.value
|
|
193
|
-
touch(meta)
|
|
194
|
-
write_atomic(path, render(meta, body))
|
|
195
|
-
ack(path, body)
|
|
196
|
-
return 0
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
def add_target(sp) -> None:
|
|
200
|
-
"""Every command addresses the memlog the same way: a run folder or an explicit path."""
|
|
201
|
-
g = sp.add_mutually_exclusive_group(required=True)
|
|
202
|
-
g.add_argument("--workspace", help="run folder; the memlog is {workspace}/.memlog.md")
|
|
203
|
-
g.add_argument("--path", help="explicit memlog file path (alternative to --workspace)")
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
def main(argv: list[str] | None = None) -> int:
|
|
207
|
-
p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
|
208
|
-
sub = p.add_subparsers(dest="cmd", required=True)
|
|
209
|
-
|
|
210
|
-
pi = sub.add_parser("init", help="create the memlog")
|
|
211
|
-
add_target(pi)
|
|
212
|
-
pi.add_argument("--field", action="append", metavar="KEY=VALUE", help="frontmatter field (repeatable)")
|
|
213
|
-
pi.set_defaults(func=cmd_init)
|
|
214
|
-
|
|
215
|
-
pa = sub.add_parser("append", help="append one entry at the end")
|
|
216
|
-
add_target(pa)
|
|
217
|
-
pa.add_argument("--text", required=True)
|
|
218
|
-
pa.add_argument("--type", help="entry kind, rendered as an inline tag")
|
|
219
|
-
pa.add_argument("--by", help="who the entry came from (e.g. user, coach); rendered into the tag")
|
|
220
|
-
pa.set_defaults(func=cmd_append)
|
|
221
|
-
|
|
222
|
-
pset = sub.add_parser("set", help="set a descriptive frontmatter field")
|
|
223
|
-
add_target(pset)
|
|
224
|
-
pset.add_argument("--key", required=True)
|
|
225
|
-
pset.add_argument("--value", required=True)
|
|
226
|
-
pset.set_defaults(func=cmd_set)
|
|
227
|
-
|
|
228
|
-
args = p.parse_args(argv)
|
|
229
|
-
return args.func(args)
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
if __name__ == "__main__":
|
|
233
|
-
sys.exit(main())
|
|
Binary file
|