@polymorphism-tech/morph-spec 10.12.1 → 11.0.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/CLAUDE.md +27 -57
- package/README.md +51 -340
- package/bin/morph-spec.js +22 -373
- package/docs/CHEATSHEET.md +37 -166
- package/docs/QUICKSTART.md +14 -74
- package/framework/CLAUDE.md +15 -26
- package/framework/MORPH.md +34 -101
- package/framework/agents.json +8 -8
- package/framework/commands/morph-apply.md +5 -5
- package/framework/commands/morph-infra.md +1 -1
- package/framework/docs/CLI.md +74 -886
- package/framework/evals/review-checklist.md +14 -14
- package/framework/hooks/README.md +21 -189
- package/framework/hooks/claude-code/core/README.md +2 -5
- package/framework/hooks/claude-code/core/conventional-commit.js +2 -2
- package/framework/hooks/claude-code/core/denylist.json +3 -3
- package/framework/hooks/claude-code/core/graph-refresh-kick.js +2 -2
- package/framework/hooks/claude-code/core/masked-exit.js +6 -6
- package/framework/hooks/claude-code/core/pre-bash-denylist.js +2 -2
- package/framework/hooks/claude-code/core/protect-spec-files.js +17 -61
- package/framework/hooks/claude-code/core/stack-changed.js +35 -0
- package/framework/hooks/claude-code/core/validate-completion.js +32 -87
- package/framework/hooks/shared/{heavy-command.js → command-kind.js} +6 -79
- package/framework/hooks/shared/command-tokens.js +0 -139
- package/framework/hooks/shared/contract.js +14 -0
- package/framework/hooks/shared/feature-slug.js +21 -0
- package/framework/hooks/shared/frontend-locations.js +0 -1
- package/framework/hooks/shared/git-paths.js +0 -15
- package/framework/hooks/shared/graph-freshness.js +0 -19
- package/framework/hooks/shared/hook-response.js +0 -7
- package/framework/hooks/shared/morph-cli.js +2 -81
- package/framework/hooks/shared/owner-words.js +2 -120
- package/framework/hooks/shared/payload-utils.js +0 -39
- package/framework/hooks/shared/report-progress.js +7 -101
- package/framework/hooks/statusline.js +16 -60
- package/framework/mcp/registry.json +2 -2
- package/framework/rules/ai-agents-standards.md +1 -1
- package/framework/rules/asaas-standards.md +1 -1
- package/framework/rules/ef-standards.md +1 -1
- package/framework/rules/gsap-standards.md +1 -1
- package/framework/rules/hangfire-standards.md +1 -1
- package/framework/rules/implement-report.md +3 -3
- package/framework/rules/neon-auth-standards.md +1 -1
- package/framework/rules/nextjs-standards.md +1 -1
- package/framework/rules/plan-grammar.md +13 -11
- package/framework/rules/resend-standards.md +1 -1
- package/framework/rules/ui-design.md +4 -0
- package/framework/schemas/config.schema.json +95 -310
- package/framework/skills/README.md +12 -32
- package/framework/skills/core/create-umbraco-lp/SKILL.md +1 -1
- package/framework/skills/core/migrate-lp-to-umbraco/SKILL.md +1 -1
- package/framework/skills/core/morph-apply/SKILL.md +21 -46
- package/framework/skills/core/morph-plan/SKILL.md +28 -63
- package/framework/skills/core/morph-uiux/SKILL.md +23 -25
- package/framework/{templates/docs/ui-mockups.md → skills/core/morph-uiux/references/mockups.md} +4 -4
- package/framework/standards/STANDARDS.json +10 -11
- package/framework/standards/STANDARDS.meta.json +1 -1
- package/framework/standards/ai-agents/evals-with-cache.md +18 -32
- package/framework/standards/ai-agents/observability-patterns.md +2 -2
- package/framework/standards/architecture/code-comments.md +2 -5
- package/framework/standards/architecture/engineering-lens.md +1 -1
- package/framework/standards/backend/dotnet/testing.md +4 -4
- package/framework/standards/frontend/nextjs/lint.md +24 -10
- package/framework/standards/frontend/nextjs/testing.md +2 -2
- package/framework/standards/infrastructure/docker/local-compose-isolation.md +14 -30
- package/framework/templates/CLAUDE.md.core.guide.md +2 -2
- package/framework/templates/README.md +1 -1
- package/framework/templates/REGISTRY.json +3 -33
- package/framework/templates/docs/plan.md +3 -2
- package/framework/templates/dotnet/ai-kit/README.md +2 -4
- package/framework/templates/dotnet/ai-kit/src/Morph.AiKit/Evals/EvalCacheMissException.cs +1 -1
- package/framework/templates/dotnet/ai-kit/src/Morph.AiKit/Evals/EvalFixture.cs +1 -1
- package/package.json +1 -2
- package/src/commands/graph/explain.js +2 -1
- package/src/commands/graph/status.js +2 -1
- package/src/commands/mcp/mcp-setup.js +1 -2
- package/src/commands/project/doctor.js +5 -341
- package/src/commands/project/env.js +21 -52
- package/src/commands/project/init-contract.js +47 -0
- package/src/commands/project/init.js +36 -66
- package/src/commands/project/stack-scan.js +1 -1
- package/src/commands/project/update.js +15 -50
- package/src/commands/validation/check.js +128 -0
- package/src/commands/validation/plan-check.js +41 -64
- package/src/commands/validation/prove-red.js +1 -1
- package/src/core/paths/output-schema.js +0 -22
- package/src/core/templates/template-renderer.js +0 -14
- package/src/lib/ai/ai-project-scan.js +1 -6
- package/src/lib/check/attempts.js +38 -0
- package/src/lib/check/signals.js +145 -0
- package/src/lib/config/project-config.js +13 -0
- package/src/lib/contract/apply.js +62 -0
- package/src/lib/contract/defaults.js +96 -0
- package/src/lib/contract/merge.js +79 -0
- package/src/lib/contract/ports.js +43 -0
- package/src/lib/contract/scan.js +102 -0
- package/src/lib/detectors/claude-config-detector.js +7 -0
- package/src/lib/{procs → detectors}/mcp-config.js +1 -37
- package/src/lib/diff/diff-lines.js +64 -0
- package/src/lib/generators/architecture-scanner.js +1 -1
- package/src/lib/generators/scaffold-generator.js +0 -7
- package/src/lib/git/default-branch.js +0 -122
- package/src/lib/graph/diff-tree.js +2 -1
- package/src/lib/graph/god-nodes.js +2 -1
- package/src/lib/graph/graphify-runtime.js +0 -1
- package/src/lib/graph/graphifyignore.js +1 -1
- package/src/lib/graph/sanitize.js +2 -8
- package/src/lib/installers/memory-installer.js +15 -30
- package/src/lib/installers/stack-sync.js +16 -9
- package/src/lib/plan/checks.js +20 -64
- package/src/lib/plan/media.js +1 -1
- package/src/lib/plan/plan-parser.js +5 -5
- package/src/lib/review-reports.js +3 -77
- package/src/lib/scan/worktree-dirs.js +3 -0
- package/src/lib/specs/adr-index.js +2 -2
- package/src/lib/stack/dotnet-build-ignores.js +10 -2
- package/src/lib/stack/stack-scan.js +2 -2
- package/src/lib/stack-filter.js +3 -2
- package/src/lib/tests-audit/audit.js +1 -1
- package/src/scripts/setup-infra.js +6 -59
- package/src/utils/agents-installer.js +1 -34
- package/src/utils/atomic-json.js +27 -0
- package/src/utils/file-copier.js +4 -12
- package/src/utils/hooks-installer.js +9 -107
- package/claude-plugin.json +0 -14
- package/framework/commands/morph-archive.md +0 -46
- package/framework/commands/morph-hotfix.md +0 -17
- package/framework/commands/morph-preflight.md +0 -180
- package/framework/commands/morph-review.md +0 -15
- package/framework/commands/morph-status.md +0 -37
- package/framework/hooks/claude-code/core/block-destructive-worktree-removal.js +0 -80
- package/framework/hooks/claude-code/core/block-raw-worktree-add.js +0 -72
- package/framework/hooks/claude-code/core/enforce-phase-writes.js +0 -100
- package/framework/hooks/claude-code/core/gate-guard.js +0 -148
- package/framework/hooks/claude-code/core/heavy-gate.js +0 -78
- package/framework/hooks/claude-code/core/heavy-release.js +0 -23
- package/framework/hooks/claude-code/core/loop-detect.js +0 -79
- package/framework/hooks/claude-code/core/state-sync.js +0 -214
- package/framework/hooks/claude-code/core/telemetry-log.js +0 -259
- package/framework/hooks/claude-code/core/test-budget.js +0 -29
- package/framework/hooks/claude-code/core/worktree-context.js +0 -249
- package/framework/hooks/claude-code/core/worktree-create.js +0 -119
- package/framework/hooks/claude-code/core/worktree-env-inject.js +0 -68
- package/framework/hooks/claude-code/core/worktree-remove.js +0 -55
- package/framework/hooks/shared/build-check.js +0 -120
- package/framework/hooks/shared/claim-registry.js +0 -125
- package/framework/hooks/shared/e2e-check.js +0 -1022
- package/framework/hooks/shared/feature-locator.js +0 -82
- package/framework/hooks/shared/gate-event.js +0 -18
- package/framework/hooks/shared/gate-question.js +0 -20
- package/framework/hooks/shared/heavy-config.js +0 -113
- package/framework/hooks/shared/heavy-holders.js +0 -85
- package/framework/hooks/shared/heavy-slots.js +0 -280
- package/framework/hooks/shared/host-services.js +0 -440
- package/framework/hooks/shared/next-step.js +0 -181
- package/framework/hooks/shared/redact-secrets.js +0 -44
- package/framework/hooks/shared/reparse-scan.js +0 -40
- package/framework/hooks/shared/state-reader.js +0 -220
- package/framework/hooks/shared/state-writer.js +0 -112
- package/framework/hooks/shared/telemetry-logger.js +0 -101
- package/framework/hooks/shared/transcript-usage.js +0 -58
- package/framework/hooks/shared/worktree-root.js +0 -71
- package/framework/phases.json +0 -92
- package/framework/schemas/feature.schema.json +0 -242
- package/framework/skills/core/morph-apply/references/hotfix.md +0 -46
- package/framework/skills/core/morph-apply/references/machine.md +0 -30
- package/framework/skills/core/morph-apply/references/review.md +0 -77
- package/framework/skills/core/morph-plan/references/critique.md +0 -51
- package/framework/skills/core/morph-plan/references/interview.md +0 -37
- package/framework/templates/state.template.json +0 -17
- package/src/commands/dashboard/dashboard.js +0 -74
- package/src/commands/e2e/e2e.js +0 -400
- package/src/commands/observability/cost.js +0 -283
- package/src/commands/project/branch.js +0 -129
- package/src/commands/project/claim.js +0 -132
- package/src/commands/project/doctor-procs.js +0 -162
- package/src/commands/project/fleet.js +0 -66
- package/src/commands/project/heavy.js +0 -81
- package/src/commands/project/install-plugin-cmd.js +0 -27
- package/src/commands/project/status.js +0 -61
- package/src/commands/project/worktree.js +0 -1234
- package/src/commands/state/advance.js +0 -248
- package/src/commands/state/approve.js +0 -303
- package/src/commands/state/archive.js +0 -231
- package/src/commands/state/auto-approval.js +0 -67
- package/src/commands/state/create.js +0 -274
- package/src/commands/state/delete.js +0 -192
- package/src/commands/state/finish.js +0 -1247
- package/src/commands/state/gate-check.js +0 -244
- package/src/commands/state/gate-decision.js +0 -122
- package/src/commands/state/list.js +0 -244
- package/src/commands/state/next.js +0 -24
- package/src/commands/state/recap.js +0 -80
- package/src/commands/state/report-check.js +0 -244
- package/src/commands/state/retype.js +0 -110
- package/src/commands/validation/verify.js +0 -421
- package/src/core/state/feature-identity.js +0 -10
- package/src/core/state/gate-order.js +0 -23
- package/src/core/state/lifecycle-audit.js +0 -171
- package/src/core/state/state-manager.js +0 -523
- package/src/core/templates/template-seed.js +0 -21
- package/src/core/work-types.js +0 -44
- package/src/dashboard/app/App.jsx +0 -84
- package/src/dashboard/app/components/ActivityFeed.jsx +0 -166
- package/src/dashboard/app/components/CommandPalette.jsx +0 -144
- package/src/dashboard/app/components/DetailPanel.jsx +0 -43
- package/src/dashboard/app/components/EntityLink.jsx +0 -42
- package/src/dashboard/app/components/ErrorBoundary.jsx +0 -47
- package/src/dashboard/app/components/FlowGraph.jsx +0 -19
- package/src/dashboard/app/components/GatePauses.jsx +0 -116
- package/src/dashboard/app/components/KnowledgeMarkdown.jsx +0 -42
- package/src/dashboard/app/components/Markdown.jsx +0 -38
- package/src/dashboard/app/components/PhaseRail.jsx +0 -100
- package/src/dashboard/app/components/SearchFilter.jsx +0 -36
- package/src/dashboard/app/components/SessionMap.jsx +0 -77
- package/src/dashboard/app/components/Sidebar.jsx +0 -147
- package/src/dashboard/app/hooks/useMorphQuery.js +0 -44
- package/src/dashboard/app/hooks/usePref.js +0 -34
- package/src/dashboard/app/lib/format.js +0 -69
- package/src/dashboard/app/lib/phases.js +0 -75
- package/src/dashboard/app/lib/project.js +0 -38
- package/src/dashboard/app/main.jsx +0 -13
- package/src/dashboard/app/pages/Activity.jsx +0 -28
- package/src/dashboard/app/pages/AgentMap.jsx +0 -363
- package/src/dashboard/app/pages/FeatureDetail.jsx +0 -579
- package/src/dashboard/app/pages/Features.jsx +0 -393
- package/src/dashboard/app/pages/Guide.jsx +0 -145
- package/src/dashboard/app/pages/HookInspector.jsx +0 -444
- package/src/dashboard/app/pages/PhasePipeline.jsx +0 -273
- package/src/dashboard/app/pages/Portfolio.jsx +0 -190
- package/src/dashboard/app/pages/RulesMap.jsx +0 -285
- package/src/dashboard/app/pages/SkillsLibrary.jsx +0 -468
- package/src/dashboard/app/pages/Standards.jsx +0 -392
- package/src/dashboard/app/styles/index.css +0 -187
- package/src/dashboard/index.html +0 -14
- package/src/dashboard/package.json +0 -32
- package/src/dashboard/scanner/activity-scanner.js +0 -321
- package/src/dashboard/scanner/agents-scanner.js +0 -67
- package/src/dashboard/scanner/docs-scanner.js +0 -34
- package/src/dashboard/scanner/feature-status.js +0 -7
- package/src/dashboard/scanner/features-scanner.js +0 -397
- package/src/dashboard/scanner/hooks-scanner.js +0 -96
- package/src/dashboard/scanner/index.js +0 -21
- package/src/dashboard/scanner/phases-scanner.js +0 -14
- package/src/dashboard/scanner/portfolio.js +0 -129
- package/src/dashboard/scanner/project-api.js +0 -160
- package/src/dashboard/scanner/rules-scanner.js +0 -46
- package/src/dashboard/scanner/skills-scanner.js +0 -104
- package/src/dashboard/scanner/standards-scanner.js +0 -38
- package/src/dashboard/vite-plugin-morph-data.js +0 -120
- package/src/dashboard/vite.config.js +0 -26
- package/src/lib/ci/ci-verify.js +0 -30
- package/src/lib/ci/github-ci.js +0 -52
- package/src/lib/ci/pr-checks.js +0 -76
- package/src/lib/e2e/applicability.js +0 -39
- package/src/lib/e2e/compose-env.js +0 -80
- package/src/lib/e2e/stack-teardown.js +0 -96
- package/src/lib/git/branch-classifier.js +0 -104
- package/src/lib/git/evidence-staleness.js +0 -40
- package/src/lib/git/gh.js +0 -15
- package/src/lib/git/pending-prs.js +0 -58
- package/src/lib/git/pr-files.js +0 -31
- package/src/lib/git/pr-index.js +0 -39
- package/src/lib/git/tree-fingerprint.js +0 -58
- package/src/lib/git/tree-state.js +0 -125
- package/src/lib/heavy/cleanup.js +0 -72
- package/src/lib/heavy/gate.js +0 -168
- package/src/lib/heavy/live-stacks.js +0 -64
- package/src/lib/heavy/reclaim.js +0 -107
- package/src/lib/heavy/watchdog.js +0 -46
- package/src/lib/next-step.js +0 -12
- package/src/lib/plan/critique.js +0 -67
- package/src/lib/plan/plan-template.js +0 -18
- package/src/lib/procs/classify.js +0 -91
- package/src/lib/procs/list.js +0 -124
- package/src/lib/procs/prune.js +0 -47
- package/src/lib/procs/wslconfig.js +0 -70
- package/src/lib/projects/registry.js +0 -121
- package/src/lib/recap/piper.js +0 -36
- package/src/lib/recap/recap.js +0 -259
- package/src/lib/review-confirmation.js +0 -66
- package/src/lib/risk/diff-risk.js +0 -137
- package/src/lib/risk-detector.js +0 -638
- package/src/lib/specs/design-seed.js +0 -18
- package/src/lib/specs/screen-checklist.js +0 -315
- package/src/lib/stack/stack-profile.js +0 -69
- package/src/lib/tasks/eval-node.js +0 -293
- package/src/lib/tasks/linux-runner.js +0 -200
- package/src/lib/tasks/test-nodes.js +0 -414
- package/src/lib/tasks/test-runner.js +0 -569
- package/src/lib/telemetry/metrics.js +0 -384
- package/src/lib/telemetry/telemetry-reader.js +0 -276
- package/src/lib/telemetry/verify-event.js +0 -57
- package/src/lib/validators/code-budget/code-budget-validator.js +0 -170
- package/src/lib/validators/contracts/contract-compliance-validator.js +0 -219
- package/src/lib/validators/nextjs/next-component-validator.js +0 -142
- package/src/lib/validators/packages/package-validator.js +0 -310
- package/src/lib/validators/reuse/reuse-validator.js +0 -202
- package/src/lib/validators/reuse/symbol-scanner.js +0 -64
- package/src/lib/validators/validation-runner.js +0 -188
- package/src/lib/validators/verify-cache.js +0 -63
- package/src/lib/validators/verify-runner.js +0 -971
- package/src/lib/verify/affected.js +0 -143
- package/src/lib/verify/detached.js +0 -159
- package/src/lib/view/feature-html.js +0 -480
- package/src/lib/view/feature-page.client.js +0 -109
- package/src/lib/view/feature-page.css +0 -278
- package/src/lib/view/feature-view.js +0 -113
- package/src/lib/view/flow-layers.js +0 -79
- package/src/lib/view/flow-svg.js +0 -63
- package/src/lib/view/tokens.css +0 -18
- package/src/lib/work-type-detector.js +0 -81
- package/src/lib/worktree/dirs.js +0 -3
- package/src/lib/worktree/docker-audit.js +0 -175
- package/src/lib/worktree/env-allocator.js +0 -177
- package/src/lib/worktree/feature-truth.js +0 -145
- package/src/lib/worktree/finish-backup.js +0 -529
- package/src/lib/worktree/fleet-scanner.js +0 -223
- package/src/lib/worktree/ignored-triage.js +0 -136
- package/src/lib/worktree/vscode-settings.js +0 -112
- package/src/lib/worktree/worktree-audit.js +0 -323
- package/src/lib/worktree/worktree-include.js +0 -44
- package/src/scripts/install-plugin.js +0 -114
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { Link, useParams } from 'react-router-dom';
|
|
3
|
-
import {
|
|
4
|
-
CheckCircle, XCircle, CircleDashed, GitBranch, Archive, HouseSimple, CaretRight, MagnifyingGlass, WarningCircle,
|
|
5
|
-
Rows, Kanban, PauseCircle,
|
|
6
|
-
} from '@phosphor-icons/react';
|
|
7
|
-
import PhaseRail from '../components/PhaseRail.jsx';
|
|
8
|
-
import { useMorphQuery } from '../hooks/useMorphQuery.js';
|
|
9
|
-
import { usePref, useNow } from '../hooks/usePref.js';
|
|
10
|
-
import { PHASES, phaseMeta, LOCATION_LABEL, GATE_LABEL, TRUST_SAY, workLabel, featureTitle } from '../lib/phases.js';
|
|
11
|
-
import { timeAgo, verdictLabel } from '../lib/format.js';
|
|
12
|
-
import { apiBase, featureHref } from '../lib/project.js';
|
|
13
|
-
import { isFinished } from '../../scanner/feature-status.js';
|
|
14
|
-
|
|
15
|
-
const COMPLETED_PAGE = 30;
|
|
16
|
-
const BOARD_DONE_LIMIT = 8;
|
|
17
|
-
export const WORKING_MS = 3 * 60 * 1000;
|
|
18
|
-
|
|
19
|
-
const LOCATION_ICON = { worktree: GitBranch, archive: Archive, root: HouseSimple };
|
|
20
|
-
const SORTS = {
|
|
21
|
-
updated: { label: 'Mais recentes', cmp: (a, b) => (lastTouch(b) || '').localeCompare(lastTouch(a) || '') },
|
|
22
|
-
name: { label: 'Nome', cmp: (a, b) => featureTitle(a).localeCompare(featureTitle(b)) },
|
|
23
|
-
verdict: { label: 'Revisão independente', cmp: (a, b) => (a.blockers ?? 99) - (b.blockers ?? 99) },
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
function lastTouch(f) {
|
|
27
|
-
const a = f.lastActivity?.ts || '';
|
|
28
|
-
const b = f.updatedAt || '';
|
|
29
|
-
return a > b ? a : b;
|
|
30
|
-
}
|
|
31
|
-
export function isWorking(f, now = Date.now()) {
|
|
32
|
-
const t = Date.parse(f.lastActivity?.ts || '');
|
|
33
|
-
return !isFinished(f) && !Number.isNaN(t) && now - t < WORKING_MS;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function VerifyMark({ verification }) {
|
|
37
|
-
if (!verification?.status) return <CircleDashed weight="light" className="text-[var(--color-faint)]" size={16} aria-label="testes automáticos ainda não rodaram" />;
|
|
38
|
-
return verification.status === 'pass'
|
|
39
|
-
? <CheckCircle weight="light" className="text-[var(--color-ok)]" size={16} aria-label="testes automáticos passaram" />
|
|
40
|
-
: <XCircle weight="light" className="text-[var(--color-bad)]" size={16} aria-label="testes automáticos falharam" />;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function ScenarioMeter({ scenarios, wide = false }) {
|
|
44
|
-
if (!scenarios?.total) return <span className="text-xs text-[var(--color-faint)]">sem cenários</span>;
|
|
45
|
-
const pct = Math.round((scenarios.done / scenarios.total) * 100);
|
|
46
|
-
return (
|
|
47
|
-
<div className="flex items-center gap-2" title={`${scenarios.done} de ${scenarios.total} cenários feitos`}>
|
|
48
|
-
<div className={`h-1 overflow-hidden rounded-full bg-white/[0.07] ${wide ? 'flex-1' : 'w-12'}`}>
|
|
49
|
-
<div className="h-full rounded-full bg-[var(--color-fg)]/70" style={{ width: `${pct}%` }} />
|
|
50
|
-
</div>
|
|
51
|
-
<span className="font-mono text-xs tabular-nums text-[var(--color-dim)]">{scenarios.done}/{scenarios.total}</span>
|
|
52
|
-
</div>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function WorkingDot() {
|
|
57
|
-
return (
|
|
58
|
-
<span className="relative inline-flex h-2 w-2 shrink-0" title="o agente está trabalhando agora" aria-label="trabalhando agora">
|
|
59
|
-
<span className="absolute inset-0 animate-ping rounded-full bg-[var(--color-phase-implement)] opacity-60 motion-reduce:hidden" />
|
|
60
|
-
<span className="relative h-2 w-2 rounded-full bg-[var(--color-phase-implement)]" />
|
|
61
|
-
</span>
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function stageText(f) {
|
|
66
|
-
if (f.status === 'completed') return 'Concluída';
|
|
67
|
-
if (f.status === 'abandoned') return 'Abandonada';
|
|
68
|
-
if (f.location === 'archive') return 'Arquivada';
|
|
69
|
-
const paused = f.gates.find((g) => g.paused);
|
|
70
|
-
if (paused) return `Esperando você: ${(GATE_LABEL[paused.gate] ?? paused.gate).toLowerCase()}`;
|
|
71
|
-
if (f.inEvaluation) return 'Em revisão independente';
|
|
72
|
-
return phaseMeta(f.phase).label;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function subline(f, now) {
|
|
76
|
-
if (!isFinished(f) && f.lastActivity?.title) {
|
|
77
|
-
return <>{isWorking(f, now) && <WorkingDot />}<span className="truncate">{f.lastActivity.title}, {timeAgo(f.lastActivity.titleTs, now)}</span></>;
|
|
78
|
-
}
|
|
79
|
-
return <span className="truncate">{stageText(f)}{f.description ? `. ${f.description}` : ''}</span>;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export function FeatureRow({ f, now, project, projectName }) {
|
|
83
|
-
const LocIcon = LOCATION_ICON[f.location] || HouseSimple;
|
|
84
|
-
const verdict = verdictLabel(f);
|
|
85
|
-
return (
|
|
86
|
-
<li>
|
|
87
|
-
<Link
|
|
88
|
-
to={featureHref(project, f.name)}
|
|
89
|
-
className="group fluid grid grid-cols-1 gap-3 px-5 py-4 transition-colors hover:bg-white/[0.025] md:grid-cols-[minmax(0,1fr)_14rem_6.5rem_1.5rem_2.5rem_6.5rem_1.75rem] md:items-center md:gap-5"
|
|
90
|
-
>
|
|
91
|
-
<div className="min-w-0">
|
|
92
|
-
<div className="flex items-center gap-2">
|
|
93
|
-
<span className="truncate font-medium text-[var(--color-fg)]" title={f.name}>{featureTitle(f)}</span>
|
|
94
|
-
{projectName && <span className="shrink-0 text-xs text-[var(--color-faint)]">{projectName}</span>}
|
|
95
|
-
{f.workType && f.workType !== 'feature' && (
|
|
96
|
-
<span className="shrink-0 rounded-full px-2 py-px text-[11px] text-[var(--color-dim)] shadow-[inset_0_0_0_1px_var(--color-hair-strong)]">{workLabel(f.workType)}</span>
|
|
97
|
-
)}
|
|
98
|
-
{f.rootStale && (
|
|
99
|
-
<WarningCircle weight="light" size={15} className="shrink-0 text-[var(--color-warn)]" aria-label="cópia da raiz possivelmente desatualizada" />
|
|
100
|
-
)}
|
|
101
|
-
</div>
|
|
102
|
-
<p className="mt-0.5 flex items-center gap-2 text-sm text-[var(--color-dim)]">{subline(f, now)}</p>
|
|
103
|
-
</div>
|
|
104
|
-
<PhaseRail feature={f} />
|
|
105
|
-
{/* One line on a phone; on desktop the wrapper dissolves into the row's grid. */}
|
|
106
|
-
<div className="flex items-center gap-5 md:contents">
|
|
107
|
-
<ScenarioMeter scenarios={f.scenarios} />
|
|
108
|
-
<VerifyMark verification={f.verification} />
|
|
109
|
-
<span className="font-mono text-sm tabular-nums text-[var(--color-dim)]" title={verdict ? 'resultado da revisão independente' : 'sem revisão independente ainda'}>
|
|
110
|
-
{verdict ?? '—'}
|
|
111
|
-
</span>
|
|
112
|
-
<span className="flex items-center gap-1.5 text-xs text-[var(--color-faint)]" title={LOCATION_LABEL[f.location]}>
|
|
113
|
-
<LocIcon weight="light" size={14} />
|
|
114
|
-
{timeAgo(lastTouch(f), now)}
|
|
115
|
-
</span>
|
|
116
|
-
</div>
|
|
117
|
-
<span className="fluid hidden h-7 w-7 items-center justify-center rounded-full bg-white/[0.04] text-[var(--color-dim)] transition-transform group-hover:translate-x-0.5 group-hover:bg-white/[0.08] group-hover:text-[var(--color-fg)] md:flex">
|
|
118
|
-
<CaretRight weight="light" size={14} />
|
|
119
|
-
</span>
|
|
120
|
-
</Link>
|
|
121
|
-
</li>
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export function Section({ title, hint, features, now, project }) {
|
|
126
|
-
return (
|
|
127
|
-
<section>
|
|
128
|
-
<div className="mb-3 flex items-baseline justify-between px-1">
|
|
129
|
-
<h2 className="text-sm font-medium text-[var(--color-fg)]">{title}</h2>
|
|
130
|
-
{hint && <span className="text-xs text-[var(--color-faint)]">{hint}</span>}
|
|
131
|
-
</div>
|
|
132
|
-
<div className="bezel">
|
|
133
|
-
<ul className="bezel-core divide-y divide-[var(--color-hair)] overflow-hidden">
|
|
134
|
-
{features.map((f) => <FeatureRow key={f.name} f={f} now={now} project={project} />)}
|
|
135
|
-
</ul>
|
|
136
|
-
</div>
|
|
137
|
-
</section>
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function BoardCard({ f, now, project }) {
|
|
142
|
-
const verdict = verdictLabel(f);
|
|
143
|
-
const paused = f.gates.find((g) => g.paused);
|
|
144
|
-
return (
|
|
145
|
-
<li>
|
|
146
|
-
<Link
|
|
147
|
-
to={featureHref(project, f.name)}
|
|
148
|
-
className={[
|
|
149
|
-
'fluid block rounded-xl bg-[var(--color-raised)] px-3.5 py-3 transition-[transform,box-shadow] hover:-translate-y-px active:scale-[0.99]',
|
|
150
|
-
paused ? 'shadow-[inset_0_0_0_1px_var(--color-warn)]' : 'shadow-[inset_0_0_0_1px_var(--color-hair),inset_0_1px_0_rgb(255_255_255_/_0.05)] hover:shadow-[inset_0_0_0_1px_var(--color-hair-strong)]',
|
|
151
|
-
].join(' ')}
|
|
152
|
-
>
|
|
153
|
-
<div className="flex items-start justify-between gap-2">
|
|
154
|
-
<span className="min-w-0 break-words text-sm font-medium leading-snug text-[var(--color-fg)]" title={f.name}>{featureTitle(f)}</span>
|
|
155
|
-
{isWorking(f, now) ? <span className="mt-1.5"><WorkingDot /></span> : null}
|
|
156
|
-
</div>
|
|
157
|
-
{paused && (
|
|
158
|
-
<p className="mt-1.5 flex items-center gap-1.5 text-xs text-[var(--color-warn)]">
|
|
159
|
-
<PauseCircle weight="light" size={14} /> esperando você
|
|
160
|
-
</p>
|
|
161
|
-
)}
|
|
162
|
-
{!paused && f.inEvaluation && <p className="mt-1.5 text-xs text-[var(--color-phase-review)]">em revisão independente</p>}
|
|
163
|
-
{f.lastActivity?.title && !isFinished(f) && (
|
|
164
|
-
<p className="mt-1.5 line-clamp-2 text-xs text-[var(--color-dim)]">{f.lastActivity.title}</p>
|
|
165
|
-
)}
|
|
166
|
-
<div className="mt-3"><ScenarioMeter scenarios={f.scenarios} wide /></div>
|
|
167
|
-
<div className="mt-2.5 flex items-center justify-between text-xs text-[var(--color-faint)]">
|
|
168
|
-
<span className="flex items-center gap-2">
|
|
169
|
-
<VerifyMark verification={f.verification} />
|
|
170
|
-
{verdict && <span className="font-mono tabular-nums text-[var(--color-dim)]">{verdict}</span>}
|
|
171
|
-
{f.workType && f.workType !== 'feature' && <span>{workLabel(f.workType)}</span>}
|
|
172
|
-
</span>
|
|
173
|
-
<span>{timeAgo(lastTouch(f), now)}</span>
|
|
174
|
-
</div>
|
|
175
|
-
</Link>
|
|
176
|
-
</li>
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export function Board({ features, showDone, now, project }) {
|
|
181
|
-
const active = features.filter((f) => !isFinished(f));
|
|
182
|
-
const done = features.filter(isFinished).slice(0, BOARD_DONE_LIMIT);
|
|
183
|
-
const columns = PHASES.map((p) => ({ ...p, items: active.filter((f) => f.phase === p.id) }));
|
|
184
|
-
if (showDone) columns.push({ id: 'done', label: 'Concluídas', color: 'var(--color-ok)', items: done });
|
|
185
|
-
return (
|
|
186
|
-
<div className="-mx-4 overflow-x-auto px-4 pb-4 md:mx-0 md:px-0">
|
|
187
|
-
<div className="grid auto-cols-[16.5rem] grid-flow-col gap-3 md:auto-cols-[minmax(11rem,1fr)]">
|
|
188
|
-
{columns.map((c) => (
|
|
189
|
-
<section key={c.id} className="bezel min-w-0" aria-label={`${c.label}: ${c.items.length}`}>
|
|
190
|
-
<div className="bezel-core flex h-full min-h-[14rem] flex-col p-2.5">
|
|
191
|
-
<h2 className="flex items-center justify-between px-1.5 pb-2.5 pt-1 text-sm">
|
|
192
|
-
<span className="flex items-center gap-2 font-medium"><span className="h-2 w-2 rounded-full" style={{ background: c.color }} />{c.label}</span>
|
|
193
|
-
<span className="font-mono text-xs text-[var(--color-faint)]">{c.items.length}</span>
|
|
194
|
-
</h2>
|
|
195
|
-
{c.items.length === 0
|
|
196
|
-
? <p className="px-1.5 text-xs text-[var(--color-faint)]">{c.id === 'done' ? 'Nada concluído ainda.' : 'Nenhuma feature aqui.'}</p>
|
|
197
|
-
: <ul className="space-y-2">{c.items.map((f) => <BoardCard key={f.name} f={f} now={now} project={project} />)}</ul>}
|
|
198
|
-
</div>
|
|
199
|
-
</section>
|
|
200
|
-
))}
|
|
201
|
-
</div>
|
|
202
|
-
</div>
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
function Empty({ title, children }) {
|
|
207
|
-
return (
|
|
208
|
-
<div className="bezel mx-auto mt-16 max-w-lg">
|
|
209
|
-
<div className="bezel-core px-8 py-10 text-center">
|
|
210
|
-
<h2 className="text-lg font-medium">{title}</h2>
|
|
211
|
-
<div className="mt-2 text-sm leading-relaxed text-[var(--color-dim)]">{children}</div>
|
|
212
|
-
</div>
|
|
213
|
-
</div>
|
|
214
|
-
);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export function Segmented({ value, onChange, options, label }) {
|
|
218
|
-
return (
|
|
219
|
-
<div role="radiogroup" aria-label={label} className="inline-flex rounded-full bg-white/[0.03] p-1 shadow-[inset_0_0_0_1px_var(--color-hair)]">
|
|
220
|
-
{options.map((o) => (
|
|
221
|
-
<button
|
|
222
|
-
key={o.id}
|
|
223
|
-
type="button"
|
|
224
|
-
role="radio"
|
|
225
|
-
aria-checked={value === o.id}
|
|
226
|
-
onClick={() => onChange(o.id)}
|
|
227
|
-
className={[
|
|
228
|
-
'fluid flex items-center gap-1.5 rounded-full px-3 py-1.5 text-sm transition-colors active:scale-[0.98]',
|
|
229
|
-
value === o.id ? 'bg-white/[0.1] text-[var(--color-fg)]' : 'text-[var(--color-dim)] hover:text-[var(--color-fg)]',
|
|
230
|
-
].join(' ')}
|
|
231
|
-
>
|
|
232
|
-
{o.icon && <o.icon weight="light" size={15} />}{o.label}
|
|
233
|
-
</button>
|
|
234
|
-
))}
|
|
235
|
-
</div>
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
const chipClass = (on) => [
|
|
240
|
-
'fluid rounded-full px-3 py-1 text-xs transition-colors active:scale-[0.98]',
|
|
241
|
-
on ? 'bg-white/[0.09] text-[var(--color-fg)] shadow-[inset_0_0_0_1px_var(--color-hair-strong)]' : 'text-[var(--color-faint)] shadow-[inset_0_0_0_1px_var(--color-hair)] hover:text-[var(--color-dim)]',
|
|
242
|
-
].join(' ');
|
|
243
|
-
|
|
244
|
-
export function FeaturesView({
|
|
245
|
-
data, query, onQuery, completedShown, onShowMore,
|
|
246
|
-
view = 'list', onView = () => {}, types = [], onTypes = () => {}, sort = 'updated', onSort = () => {},
|
|
247
|
-
showDone = true, onShowDone = () => {}, now = Date.now(), searchRef, project,
|
|
248
|
-
}) {
|
|
249
|
-
const { project: info, features } = data;
|
|
250
|
-
const q = query.trim().toLowerCase();
|
|
251
|
-
const presentTypes = [...new Set(features.map((f) => f.workType || 'feature'))].sort();
|
|
252
|
-
const visible = features
|
|
253
|
-
.filter((f) => !q || f.name.toLowerCase().includes(q) || featureTitle(f).toLowerCase().includes(q) || (f.description || '').toLowerCase().includes(q))
|
|
254
|
-
.filter((f) => types.length === 0 || types.includes(f.workType || 'feature'))
|
|
255
|
-
.sort(SORTS[sort]?.cmp || SORTS.updated.cmp);
|
|
256
|
-
const awaiting = visible.filter((f) => f.awaiting);
|
|
257
|
-
const active = visible.filter((f) => !f.awaiting && !isFinished(f));
|
|
258
|
-
const done = visible.filter(isFinished);
|
|
259
|
-
const working = features.filter((f) => isWorking(f, now)).length;
|
|
260
|
-
|
|
261
|
-
return (
|
|
262
|
-
<div className="mx-auto max-w-7xl px-4 pb-24 pt-10 md:px-10 md:pt-14">
|
|
263
|
-
<header className="rise mb-8">
|
|
264
|
-
<p className="text-sm text-[var(--color-dim)]">Projeto</p>
|
|
265
|
-
<h1 className="mt-1 break-words text-4xl font-semibold tracking-tight md:text-5xl">{info.name}</h1>
|
|
266
|
-
<p className="mt-3 flex flex-wrap items-center gap-x-2 text-sm text-[var(--color-dim)]">
|
|
267
|
-
{info.stack && <span>stack <span className="font-mono text-[var(--color-fg)]">{info.stack}</span>,</span>}
|
|
268
|
-
<span>{TRUST_SAY[info.trust || 'auto'] ?? info.trust},</span>
|
|
269
|
-
<span>{features.filter((f) => !isFinished(f)).length} ativas de {features.length}</span>
|
|
270
|
-
{working > 0 && <span className="flex items-center gap-1.5 text-[var(--color-phase-implement)]"><WorkingDot /> {working} com agente trabalhando agora</span>}
|
|
271
|
-
</p>
|
|
272
|
-
</header>
|
|
273
|
-
|
|
274
|
-
{features.length > 0 && (
|
|
275
|
-
<div className="rise-2 mb-8 flex flex-col gap-3 md:flex-row md:items-center md:justify-between">
|
|
276
|
-
<div className="flex flex-wrap items-center gap-2">
|
|
277
|
-
<Segmented label="Visualização" value={view} onChange={onView} options={[{ id: 'list', label: 'Lista', icon: Rows }, { id: 'board', label: 'Quadro', icon: Kanban }]} />
|
|
278
|
-
{presentTypes.length > 1 && presentTypes.map((t) => (
|
|
279
|
-
<button key={t} type="button" aria-pressed={types.includes(t)} className={chipClass(types.includes(t))}
|
|
280
|
-
onClick={() => onTypes(types.includes(t) ? types.filter((x) => x !== t) : [...types, t])}>{workLabel(t)}</button>
|
|
281
|
-
))}
|
|
282
|
-
{view === 'board' && (
|
|
283
|
-
<button type="button" aria-pressed={showDone} className={chipClass(showDone)} onClick={() => onShowDone(!showDone)}>concluídas recentes</button>
|
|
284
|
-
)}
|
|
285
|
-
</div>
|
|
286
|
-
<div className="flex items-center gap-2">
|
|
287
|
-
{view === 'list' && (
|
|
288
|
-
<label className="text-sm text-[var(--color-dim)]">
|
|
289
|
-
<span className="sr-only">Ordenar por</span>
|
|
290
|
-
<select value={sort} onChange={(e) => onSort(e.target.value)}
|
|
291
|
-
className="fluid rounded-full bg-white/[0.04] px-3 py-2 text-sm text-[var(--color-fg)] shadow-[inset_0_0_0_1px_var(--color-hair)] outline-none">
|
|
292
|
-
{Object.entries(SORTS).map(([id, s]) => <option key={id} value={id}>{s.label}</option>)}
|
|
293
|
-
</select>
|
|
294
|
-
</label>
|
|
295
|
-
)}
|
|
296
|
-
<label className="relative block w-full md:w-72">
|
|
297
|
-
<span className="sr-only">Buscar feature</span>
|
|
298
|
-
<MagnifyingGlass weight="light" size={16} className="pointer-events-none absolute left-3.5 top-1/2 -translate-y-1/2 text-[var(--color-faint)]" />
|
|
299
|
-
<input
|
|
300
|
-
ref={searchRef}
|
|
301
|
-
value={query}
|
|
302
|
-
onChange={(e) => onQuery(e.target.value)}
|
|
303
|
-
onKeyDown={(e) => { if (e.key === 'Escape') { onQuery(''); e.currentTarget.blur(); } }}
|
|
304
|
-
placeholder="Buscar feature"
|
|
305
|
-
className="fluid w-full rounded-full bg-white/[0.04] py-2 pl-10 pr-10 text-sm text-[var(--color-fg)] shadow-[inset_0_0_0_1px_var(--color-hair)] outline-none transition-shadow placeholder:text-[var(--color-faint)] focus:shadow-[inset_0_0_0_1px_var(--color-hair-strong)]"
|
|
306
|
-
/>
|
|
307
|
-
<kbd className="pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 rounded-md px-1.5 font-mono text-[11px] text-[var(--color-faint)] shadow-[inset_0_0_0_1px_var(--color-hair)]">/</kbd>
|
|
308
|
-
</label>
|
|
309
|
-
</div>
|
|
310
|
-
</div>
|
|
311
|
-
)}
|
|
312
|
-
|
|
313
|
-
{!info.initialized && (
|
|
314
|
-
<Empty title="Este diretório não usa morph-spec">
|
|
315
|
-
Rode <code className="font-mono text-[var(--color-fg)]">morph-spec init</code> na raiz do projeto e abra o dashboard de novo.
|
|
316
|
-
</Empty>
|
|
317
|
-
)}
|
|
318
|
-
{info.legacyStateOnly && (
|
|
319
|
-
<Empty title="Projeto no modelo de estado antigo">
|
|
320
|
-
As features deste projeto vivem só no <code className="font-mono">state.json</code>, sem <code className="font-mono">feature.json</code> por feature.
|
|
321
|
-
Rode <code className="font-mono text-[var(--color-fg)]">morph-spec update</code> para migrar.
|
|
322
|
-
</Empty>
|
|
323
|
-
)}
|
|
324
|
-
{info.initialized && !info.legacyStateOnly && features.length === 0 && (
|
|
325
|
-
<Empty title="Nenhuma feature ainda">
|
|
326
|
-
No Claude Code, comece uma com <code className="font-mono text-[var(--color-fg)]">/morph-plan</code>, que entrevista e escreve o plano. Ela aparece aqui assim que o <code className="font-mono">feature.json</code> nascer.
|
|
327
|
-
</Empty>
|
|
328
|
-
)}
|
|
329
|
-
{features.length > 0 && visible.length === 0 && (
|
|
330
|
-
<p className="px-1 text-sm text-[var(--color-dim)]">Nenhuma feature com esses filtros.</p>
|
|
331
|
-
)}
|
|
332
|
-
|
|
333
|
-
{view === 'board' && visible.length > 0 && <div className="rise-3"><Board features={visible} showDone={showDone} now={now} project={project} /></div>}
|
|
334
|
-
|
|
335
|
-
{view === 'list' && (
|
|
336
|
-
<div className="rise-3 space-y-10">
|
|
337
|
-
{awaiting.length > 0 && <Section title="Esperando você" hint="uma aprovação é sua" features={awaiting} now={now} project={project} />}
|
|
338
|
-
{active.length > 0 && <Section title="Em andamento" hint={`${active.length}`} features={active} now={now} project={project} />}
|
|
339
|
-
{done.length > 0 && (
|
|
340
|
-
<div>
|
|
341
|
-
<Section title="Concluídas" hint={`${done.length}`} features={done.slice(0, completedShown)} now={now} project={project} />
|
|
342
|
-
{done.length > completedShown && (
|
|
343
|
-
<button
|
|
344
|
-
type="button"
|
|
345
|
-
onClick={onShowMore}
|
|
346
|
-
className="fluid mt-4 rounded-full px-4 py-2 text-sm text-[var(--color-dim)] shadow-[inset_0_0_0_1px_var(--color-hair)] transition-colors hover:text-[var(--color-fg)] active:scale-[0.98]"
|
|
347
|
-
>
|
|
348
|
-
Mostrar mais {Math.min(COMPLETED_PAGE, done.length - completedShown)}
|
|
349
|
-
</button>
|
|
350
|
-
)}
|
|
351
|
-
</div>
|
|
352
|
-
)}
|
|
353
|
-
</div>
|
|
354
|
-
)}
|
|
355
|
-
</div>
|
|
356
|
-
);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
export default function Features() {
|
|
360
|
-
const { project } = useParams();
|
|
361
|
-
const { data, error, loading } = useMorphQuery(`${apiBase(project)}/features`, { scope: ['features', 'activity'], project });
|
|
362
|
-
const [query, setQuery] = useState('');
|
|
363
|
-
const [completedShown, setCompletedShown] = useState(COMPLETED_PAGE);
|
|
364
|
-
const [view, setView] = usePref('features.view', 'list');
|
|
365
|
-
const [types, setTypes] = usePref('features.types', []);
|
|
366
|
-
const [sort, setSort] = usePref('features.sort', 'updated');
|
|
367
|
-
const [showDone, setShowDone] = usePref('features.board.showDone', true);
|
|
368
|
-
const now = useNow();
|
|
369
|
-
const searchRef = useRef(null);
|
|
370
|
-
|
|
371
|
-
useEffect(() => {
|
|
372
|
-
const onKey = (e) => {
|
|
373
|
-
if (e.key !== '/' || e.ctrlKey || e.metaKey || e.altKey) return;
|
|
374
|
-
const tag = document.activeElement?.tagName;
|
|
375
|
-
if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') return;
|
|
376
|
-
e.preventDefault();
|
|
377
|
-
searchRef.current?.focus();
|
|
378
|
-
};
|
|
379
|
-
window.addEventListener('keydown', onKey);
|
|
380
|
-
return () => window.removeEventListener('keydown', onKey);
|
|
381
|
-
}, []);
|
|
382
|
-
|
|
383
|
-
if (error) return <Empty title="Não consegui ler as features">{error}</Empty>;
|
|
384
|
-
if (loading || !data) return <p className="px-10 pt-16 text-sm text-[var(--color-faint)]">Lendo o projeto…</p>;
|
|
385
|
-
return (
|
|
386
|
-
<FeaturesView
|
|
387
|
-
data={data} query={query} onQuery={setQuery} completedShown={completedShown}
|
|
388
|
-
onShowMore={() => setCompletedShown((n) => n + COMPLETED_PAGE)}
|
|
389
|
-
view={view} onView={setView} types={types} onTypes={setTypes} sort={sort} onSort={setSort}
|
|
390
|
-
showDone={showDone} onShowDone={setShowDone} now={now} searchRef={searchRef} project={project}
|
|
391
|
-
/>
|
|
392
|
-
);
|
|
393
|
-
}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { useMemo, useState } from 'react';
|
|
2
|
-
import { Link, useParams } from 'react-router-dom';
|
|
3
|
-
import GithubSlugger from 'github-slugger';
|
|
4
|
-
import morphData from 'virtual:morph-data';
|
|
5
|
-
import KnowledgeMarkdown from '../components/KnowledgeMarkdown.jsx';
|
|
6
|
-
import EntityLink from '../components/EntityLink.jsx';
|
|
7
|
-
import { PHASES, GATE_LABEL } from '../lib/phases.js';
|
|
8
|
-
|
|
9
|
-
const GUIDE = morphData.docs?.guide || [];
|
|
10
|
-
|
|
11
|
-
/** Same slugs rehype-slug gives the rendered headings, in document order. */
|
|
12
|
-
export function tocOf(doc) {
|
|
13
|
-
const slugger = new GithubSlugger();
|
|
14
|
-
return (doc?.headings || []).map((h) => ({ ...h, slug: slugger.slug(h.text) }));
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function personasIn(phaseId) {
|
|
18
|
-
return (morphData.agents?.list || []).filter((a) => a.activePhases?.includes(phaseId));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function Flow() {
|
|
22
|
-
return (
|
|
23
|
-
<section aria-label="O fluxo do morph-spec" className="bezel">
|
|
24
|
-
<div className="bezel-core px-5 py-6 md:px-8">
|
|
25
|
-
<h2 className="text-lg font-semibold tracking-tight">Como uma feature anda</h2>
|
|
26
|
-
<p className="mt-1 max-w-3xl text-sm leading-relaxed text-[var(--color-dim)]">
|
|
27
|
-
Você descreve o que quer; o Claude conduz cada etapa e para nos pontos de aprovação.
|
|
28
|
-
No modo padrão, que aprova sozinho quando não há risco, uma aprovação só espera você quando aparece algo arriscado.
|
|
29
|
-
No fim, uma revisão independente confere as entregas e o código e aprova ou pede correção.
|
|
30
|
-
</p>
|
|
31
|
-
<ol className="mt-6 grid gap-3 md:grid-cols-4">
|
|
32
|
-
{PHASES.map((p) => {
|
|
33
|
-
const people = personasIn(p.id);
|
|
34
|
-
return (
|
|
35
|
-
<li key={p.id} className="relative rounded-xl bg-[var(--color-raised)] p-4 shadow-[inset_0_0_0_1px_var(--color-hair)]">
|
|
36
|
-
<span className="absolute inset-x-4 top-0 h-0.5 rounded-full" style={{ background: p.color }} />
|
|
37
|
-
<p className="flex items-baseline justify-between gap-2">
|
|
38
|
-
<EntityLink kind="phase" id={p.id} plain className="font-medium text-[var(--color-fg)] underline-offset-2 hover:underline">{p.label}</EntityLink>
|
|
39
|
-
{p.optional && <span className="text-xs text-[var(--color-faint)]">opcional</span>}
|
|
40
|
-
</p>
|
|
41
|
-
{p.skill && <p className="mt-2 text-xs text-[var(--color-dim)]">skill <EntityLink kind="skill" id={p.skill} className="font-mono" /></p>}
|
|
42
|
-
{people.length > 0 && (
|
|
43
|
-
<p className="mt-2 flex flex-wrap gap-1.5">
|
|
44
|
-
{people.map((a) => <EntityLink key={a.id} kind="persona" id={a.id} chip>{a.id}</EntityLink>)}
|
|
45
|
-
</p>
|
|
46
|
-
)}
|
|
47
|
-
{GATE_LABEL[p.id] && (
|
|
48
|
-
<p className="mt-3 flex items-center gap-1.5 text-xs text-[var(--color-dim)]">
|
|
49
|
-
<span className="h-2 w-2 rounded-full ring-1 ring-[var(--color-ok)]" /> termina na {GATE_LABEL[p.id].toLowerCase()}
|
|
50
|
-
</p>
|
|
51
|
-
)}
|
|
52
|
-
</li>
|
|
53
|
-
);
|
|
54
|
-
})}
|
|
55
|
-
</ol>
|
|
56
|
-
</div>
|
|
57
|
-
</section>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function GuideView({ docId }) {
|
|
62
|
-
const doc = GUIDE.find((d) => d.id === docId) || GUIDE[0];
|
|
63
|
-
const toc = useMemo(() => tocOf(doc).filter((h) => h.depth >= 2), [doc]);
|
|
64
|
-
const [filter, setFilter] = useState('');
|
|
65
|
-
const q = filter.trim().toLowerCase();
|
|
66
|
-
const shown = q ? toc.filter((h) => h.text.toLowerCase().includes(q)) : toc;
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<div className="mx-auto max-w-7xl px-4 pb-24 pt-10 md:px-10 md:pt-14">
|
|
70
|
-
<header className="rise mb-8">
|
|
71
|
-
<h1 className="text-4xl font-semibold tracking-tight md:text-5xl">Guia</h1>
|
|
72
|
-
<p className="mt-3 max-w-2xl text-sm leading-relaxed text-[var(--color-dim)]">
|
|
73
|
-
O que o morph-spec instala no seu projeto e como o Claude o usa. Os nomes de skills, personas e standards citados no texto levam às páginas deles.
|
|
74
|
-
</p>
|
|
75
|
-
</header>
|
|
76
|
-
|
|
77
|
-
<div className="rise-2 mb-10"><Flow /></div>
|
|
78
|
-
|
|
79
|
-
{!doc && <p className="text-sm text-[var(--color-dim)]">Nenhum documento do framework encontrado.</p>}
|
|
80
|
-
{doc && (
|
|
81
|
-
<>
|
|
82
|
-
<nav aria-label="Documentos" className="rise-3 mb-6 grid gap-2 md:grid-cols-3">
|
|
83
|
-
{GUIDE.map((d) => {
|
|
84
|
-
const active = d.id === doc.id;
|
|
85
|
-
return (
|
|
86
|
-
<Link
|
|
87
|
-
key={d.id}
|
|
88
|
-
to={`/guide/${d.id}`}
|
|
89
|
-
aria-current={active ? 'page' : undefined}
|
|
90
|
-
className={[
|
|
91
|
-
'fluid rounded-xl px-4 py-3 transition-colors',
|
|
92
|
-
active ? 'bg-white/[0.07] shadow-[inset_0_0_0_1px_var(--color-hair-strong)]' : 'shadow-[inset_0_0_0_1px_var(--color-hair)] hover:bg-white/[0.03]',
|
|
93
|
-
].join(' ')}
|
|
94
|
-
>
|
|
95
|
-
<p className="text-sm font-medium text-[var(--color-fg)]">{d.title}</p>
|
|
96
|
-
<p className="mt-0.5 text-xs leading-relaxed text-[var(--color-dim)]">{d.summary}</p>
|
|
97
|
-
</Link>
|
|
98
|
-
);
|
|
99
|
-
})}
|
|
100
|
-
</nav>
|
|
101
|
-
|
|
102
|
-
<div className="grid gap-6 lg:grid-cols-[15rem_minmax(0,1fr)]">
|
|
103
|
-
<aside className="lg:sticky lg:top-4 lg:max-h-[calc(100dvh-2rem)] lg:self-start lg:overflow-y-auto">
|
|
104
|
-
<label className="mb-3 block">
|
|
105
|
-
<span className="sr-only">Filtrar seções</span>
|
|
106
|
-
<input
|
|
107
|
-
value={filter}
|
|
108
|
-
onChange={(e) => setFilter(e.target.value)}
|
|
109
|
-
placeholder="Filtrar seções"
|
|
110
|
-
className="fluid w-full rounded-full bg-white/[0.04] px-3.5 py-1.5 text-sm text-[var(--color-fg)] shadow-[inset_0_0_0_1px_var(--color-hair)] outline-none placeholder:text-[var(--color-faint)]"
|
|
111
|
-
/>
|
|
112
|
-
</label>
|
|
113
|
-
<ul className="space-y-0.5 text-sm">
|
|
114
|
-
{shown.map((h) => (
|
|
115
|
-
<li key={h.slug}>
|
|
116
|
-
<a
|
|
117
|
-
href={`#${h.slug}`}
|
|
118
|
-
className={[
|
|
119
|
-
'fluid block truncate rounded-md py-1 text-[var(--color-dim)] transition-colors hover:bg-white/[0.04] hover:text-[var(--color-fg)]',
|
|
120
|
-
h.depth === 3 ? 'pl-5 text-xs' : 'pl-2',
|
|
121
|
-
].join(' ')}
|
|
122
|
-
title={h.text}
|
|
123
|
-
>
|
|
124
|
-
{h.text}
|
|
125
|
-
</a>
|
|
126
|
-
</li>
|
|
127
|
-
))}
|
|
128
|
-
</ul>
|
|
129
|
-
</aside>
|
|
130
|
-
<div className="bezel min-w-0">
|
|
131
|
-
<div className="bezel-core min-w-0 px-6 py-8 md:px-12 md:py-10">
|
|
132
|
-
<KnowledgeMarkdown text={doc.content} />
|
|
133
|
-
</div>
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
</>
|
|
137
|
-
)}
|
|
138
|
-
</div>
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export default function Guide() {
|
|
143
|
-
const { doc } = useParams();
|
|
144
|
-
return <GuideView docId={doc} />;
|
|
145
|
-
}
|